Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
L
libzmq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
libzmq
Commits
4a43a0d0
Commit
4a43a0d0
authored
Aug 25, 2012
by
Pieter Hintjens
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #413 from Quuxplusone/static-analysis
Various bugfixes found by compiling with extra warnings
parents
d588dbf2
7fadd708
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
37 additions
and
14 deletions
+37
-14
ctx.cpp
src/ctx.cpp
+9
-1
ctx.hpp
src/ctx.hpp
+2
-1
fd.hpp
src/fd.hpp
+1
-1
pipe.cpp
src/pipe.cpp
+1
-1
session_base.cpp
src/session_base.cpp
+6
-1
session_base.hpp
src/session_base.hpp
+2
-0
socket_base.cpp
src/socket_base.cpp
+6
-1
socket_base.hpp
src/socket_base.hpp
+2
-0
tcp_address.cpp
src/tcp_address.cpp
+5
-7
zmq.cpp
src/zmq.cpp
+3
-1
No files found.
src/ctx.cpp
View file @
4a43a0d0
...
...
@@ -353,7 +353,15 @@ zmq::endpoint_t zmq::ctx_t::find_endpoint (const char *addr_)
return
endpoint
;
}
void
zmq
::
ctx_t
::
monitor_event
(
zmq
::
socket_base_t
*
socket_
,
int
event_
,
va_list
args_
)
void
zmq
::
ctx_t
::
monitor_event
(
zmq
::
socket_base_t
*
socket_
,
int
event_
,
...)
{
va_list
args
;
va_start
(
event_
,
args
);
va_monitor_event
(
socket_
,
event_
,
args
);
va_end
(
args
);
}
void
zmq
::
ctx_t
::
va_monitor_event
(
zmq
::
socket_base_t
*
socket_
,
int
event_
,
va_list
args_
)
{
if
(
monitor_fn
!=
NULL
)
{
zmq_event_data_t
data
;
...
...
src/ctx.hpp
View file @
4a43a0d0
...
...
@@ -97,7 +97,8 @@ namespace zmq
// Monitoring specific
int
monitor
(
zmq_monitor_fn
*
monitor_
);
void
monitor_event
(
zmq
::
socket_base_t
*
socket_
,
int
event_
,
va_list
args_
);
void
monitor_event
(
zmq
::
socket_base_t
*
socket_
,
int
event_
,
...);
void
va_monitor_event
(
zmq
::
socket_base_t
*
socket_
,
int
event_
,
va_list
args_
);
enum
{
term_tid
=
0
,
...
...
src/fd.hpp
View file @
4a43a0d0
...
...
@@ -35,7 +35,7 @@ namespace zmq
enum
{
retired_fd
=
(
fd_t
)(
~
0
)};
#else
typedef
SOCKET
fd_t
;
enum
{
retired_fd
=
INVALID_SOCKET
};
enum
{
retired_fd
=
(
fd_t
)
INVALID_SOCKET
};
#endif
#else
typedef
int
fd_t
;
...
...
src/pipe.cpp
View file @
4a43a0d0
...
...
@@ -190,7 +190,7 @@ void zmq::pipe_t::rollback ()
void
zmq
::
pipe_t
::
flush
()
{
// If terminate() was already called do nothing.
if
(
state
==
terminated
&&
state
==
double_terminated
)
if
(
state
==
terminated
||
state
==
double_terminated
)
return
;
// The peer does not exist anymore at this point.
...
...
src/session_base.cpp
View file @
4a43a0d0
...
...
@@ -290,10 +290,15 @@ void zmq::session_base_t::monitor_event (int event_, ...)
{
va_list
args
;
va_start
(
args
,
event_
);
socket
->
monitor_event
(
event_
,
args
);
va_
monitor_event
(
event_
,
args
);
va_end
(
args
);
}
void
zmq
::
session_base_t
::
va_monitor_event
(
int
event_
,
va_list
args
)
{
socket
->
va_monitor_event
(
event_
,
args
);
}
void
zmq
::
session_base_t
::
process_plug
()
{
if
(
connect
)
...
...
src/session_base.hpp
View file @
4a43a0d0
...
...
@@ -24,6 +24,7 @@
#define __ZMQ_SESSION_BASE_HPP_INCLUDED__
#include <string>
#include <stdarg.h>
#include "own.hpp"
#include "io_object.hpp"
...
...
@@ -67,6 +68,7 @@ namespace zmq
void
terminated
(
zmq
::
pipe_t
*
pipe_
);
void
monitor_event
(
int
event_
,
...);
void
va_monitor_event
(
int
event_
,
va_list
args
);
protected
:
...
...
src/socket_base.cpp
View file @
4a43a0d0
...
...
@@ -1001,6 +1001,11 @@ void zmq::socket_base_t::monitor_event (int event_, ...)
{
va_list
args
;
va_start
(
args
,
event_
);
get_ctx
()
->
monitor_event
(
this
,
event_
,
args
);
va_monitor_event
(
event
,
args
);
va_end
(
args
);
}
void
zmq
::
socket_base_t
::
monitor_event
(
int
event_
,
va_list
args
)
{
get_ctx
()
->
va_monitor_event
(
this
,
event_
,
args
);
}
src/socket_base.hpp
View file @
4a43a0d0
...
...
@@ -25,6 +25,7 @@
#include <string>
#include <map>
#include <stdarg.h>
#include "own.hpp"
#include "array.hpp"
...
...
@@ -102,6 +103,7 @@ namespace zmq
void
unlock
();
void
monitor_event
(
int
event_
,
...);
void
va_monitor_event
(
int
event_
,
va_list
args
);
protected
:
...
...
src/tcp_address.cpp
View file @
4a43a0d0
...
...
@@ -294,12 +294,12 @@ int zmq::tcp_address_t::resolve_interface (const char *interface_,
}
// Use the first result.
zmq_assert
(
res
!=
NULL
);
zmq_assert
((
size_t
)
(
res
->
ai_addrlen
)
<=
sizeof
(
address
));
memcpy
(
&
address
,
res
->
ai_addr
,
res
->
ai_addrlen
);
// Cleanup getaddrinfo after copying the possibly referenced result.
if
(
res
)
freeaddrinfo
(
res
);
freeaddrinfo
(
res
);
return
0
;
}
...
...
@@ -598,11 +598,9 @@ const bool zmq::tcp_address_mask_t::match_address (const struct sockaddr *ss, co
}
if
(
address_mask
<
mask
)
mask
=
address_mask
;
int
full_bytes
=
mask
/
8
;
if
(
full_bytes
)
{
if
(
memcmp
(
our_bytes
,
their_bytes
,
full_bytes
))
return
false
;
}
size_t
full_bytes
=
mask
/
8
;
if
(
memcmp
(
our_bytes
,
their_bytes
,
full_bytes
))
return
false
;
uint8_t
last_byte_bits
=
(
0xffU
<<
(
8
-
(
mask
%
8
)))
&
0xffU
;
if
(
last_byte_bits
)
{
...
...
src/zmq.cpp
View file @
4a43a0d0
...
...
@@ -486,9 +486,11 @@ int zmq_recviov (void *s_, iovec *a_, size_t *count_, int flags_)
}
zmq
::
socket_base_t
*
s
=
(
zmq
::
socket_base_t
*
)
s_
;
size_t
count
=
(
int
)
*
count_
;
size_t
count
=
*
count_
;
int
nread
=
0
;
bool
recvmore
=
true
;
*
count_
=
0
;
for
(
size_t
i
=
0
;
recvmore
&&
i
<
count
;
++
i
)
{
// Cheat! We never close any msg
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment