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
ffe4a1c6
Commit
ffe4a1c6
authored
Feb 06, 2016
by
Constantin Rack
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1776 from hintjens/master
Refinement of #
f4fe375b
parents
39563d70
a1f51b69
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
127 additions
and
30 deletions
+127
-30
libzmq.vcxproj.filters
builds/msvc/vs2010/libzmq/libzmq.vcxproj.filters
+31
-1
libzmq.vcxproj.filters
builds/msvc/vs2012/libzmq/libzmq.vcxproj.filters
+31
-1
libzmq.vcxproj.filters
builds/msvc/vs2013/libzmq/libzmq.vcxproj.filters
+30
-0
zmq_recv.txt
doc/zmq_recv.txt
+2
-1
dealer.cpp
src/dealer.cpp
+1
-2
options.cpp
src/options.cpp
+1
-2
req.cpp
src/req.cpp
+2
-2
router.cpp
src/router.cpp
+1
-2
stream.cpp
src/stream.cpp
+2
-2
sub.cpp
src/sub.cpp
+4
-2
xsub.cpp
src/xsub.cpp
+6
-2
zmq.cpp
src/zmq.cpp
+13
-9
test_msg_ffn.cpp
tests/test_msg_ffn.cpp
+1
-2
test_timers.cpp
tests/test_timers.cpp
+2
-2
No files found.
builds/msvc/vs2010/libzmq/libzmq.vcxproj.filters
View file @
ffe4a1c6
...
...
@@ -238,7 +238,22 @@
<ClCompile
Include=
"..\..\..\..\src\decoder_allocators.cpp"
>
<Filter>
src
</Filter>
</ClCompile>
<ClCompile
Include=
"..\..\..\..\src\socket_poller.cpp"
>
<ClCompile
Include=
"..\..\..\..\src\socket_poller.cpp"
>
<Filter>
src
</Filter>
</ClCompile>
<ClCompile
Include=
"..\..\..\..\src\udp_address.cpp"
>
<Filter>
src
</Filter>
</ClCompile>
<ClCompile
Include=
"..\..\..\..\src\udp_engine.cpp"
>
<Filter>
src
</Filter>
</ClCompile>
<ClCompile
Include=
"..\..\..\..\src\dish.cpp"
>
<Filter>
src
</Filter>
</ClCompile>
<ClCompile
Include=
"..\..\..\..\src\radio.cpp"
>
<Filter>
src
</Filter>
</ClCompile>
<ClCompile
Include=
"..\..\..\..\src\timers.cpp"
>
<Filter>
src
</Filter>
</ClCompile>
</ItemGroup>
...
...
@@ -519,6 +534,21 @@
<ClInclude
Include=
"..\..\..\..\src\decoder_allocators.hpp"
>
<Filter>
src\include
</Filter>
</ClInclude>
<ClInclude
Include=
"..\..\..\..\src\udp_address.hpp"
>
<Filter>
src\include
</Filter>
</ClInclude>
<ClInclude
Include=
"..\..\..\..\src\udp_engine.hpp"
>
<Filter>
src\include
</Filter>
</ClInclude>
<ClInclude
Include=
"..\..\..\..\src\dish.hpp"
>
<Filter>
src\include
</Filter>
</ClInclude>
<ClInclude
Include=
"..\..\..\..\src\radio.hpp"
>
<Filter>
src\include
</Filter>
</ClInclude>
<ClInclude
Include=
"..\..\..\..\src\timers.hpp"
>
<Filter>
src\include
</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<Filter
Include=
"include"
>
...
...
builds/msvc/vs2012/libzmq/libzmq.vcxproj.filters
View file @
ffe4a1c6
...
...
@@ -238,7 +238,22 @@
<ClCompile
Include=
"..\..\..\..\src\decoder_allocators.cpp"
>
<Filter>
src
</Filter>
</ClCompile>
<ClCompile
Include=
"..\..\..\..\src\socket_poller.cpp"
>
<ClCompile
Include=
"..\..\..\..\src\socket_poller.cpp"
>
<Filter>
src
</Filter>
</ClCompile>
<ClCompile
Include=
"..\..\..\..\src\udp_address.cpp"
>
<Filter>
src
</Filter>
</ClCompile>
<ClCompile
Include=
"..\..\..\..\src\udp_engine.cpp"
>
<Filter>
src
</Filter>
</ClCompile>
<ClCompile
Include=
"..\..\..\..\src\dish.cpp"
>
<Filter>
src
</Filter>
</ClCompile>
<ClCompile
Include=
"..\..\..\..\src\radio.cpp"
>
<Filter>
src
</Filter>
</ClCompile>
<ClCompile
Include=
"..\..\..\..\src\timers.cpp"
>
<Filter>
src
</Filter>
</ClCompile>
</ItemGroup>
...
...
@@ -519,6 +534,21 @@
<ClInclude
Include=
"..\..\..\..\src\decoder_allocators.hpp"
>
<Filter>
src\include
</Filter>
</ClInclude>
<ClInclude
Include=
"..\..\..\..\src\udp_address.hpp"
>
<Filter>
src\include
</Filter>
</ClInclude>
<ClInclude
Include=
"..\..\..\..\src\udp_engine.hpp"
>
<Filter>
src\include
</Filter>
</ClInclude>
<ClInclude
Include=
"..\..\..\..\src\dish.hpp"
>
<Filter>
src\include
</Filter>
</ClInclude>
<ClInclude
Include=
"..\..\..\..\src\radio.hpp"
>
<Filter>
src\include
</Filter>
</ClInclude>
<ClInclude
Include=
"..\..\..\..\src\timers.hpp"
>
<Filter>
src\include
</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<Filter
Include=
"include"
>
...
...
builds/msvc/vs2013/libzmq/libzmq.vcxproj.filters
View file @
ffe4a1c6
...
...
@@ -241,6 +241,21 @@
<ClCompile
Include=
"..\..\..\..\src\socket_poller.cpp"
>
<Filter>
src
</Filter>
</ClCompile>
<ClCompile
Include=
"..\..\..\..\src\udp_address.cpp"
>
<Filter>
src
</Filter>
</ClCompile>
<ClCompile
Include=
"..\..\..\..\src\udp_engine.cpp"
>
<Filter>
src
</Filter>
</ClCompile>
<ClCompile
Include=
"..\..\..\..\src\dish.cpp"
>
<Filter>
src
</Filter>
</ClCompile>
<ClCompile
Include=
"..\..\..\..\src\radio.cpp"
>
<Filter>
src
</Filter>
</ClCompile>
<ClCompile
Include=
"..\..\..\..\src\timers.cpp"
>
<Filter>
src
</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude
Include=
"..\..\..\..\include\zmq.h"
>
...
...
@@ -519,6 +534,21 @@
<ClInclude
Include=
"..\..\..\..\src\decoder_allocators.hpp"
>
<Filter>
src\include
</Filter>
</ClInclude>
<ClInclude
Include=
"..\..\..\..\src\udp_address.hpp"
>
<Filter>
src\include
</Filter>
</ClInclude>
<ClInclude
Include=
"..\..\..\..\src\udp_engine.hpp"
>
<Filter>
src\include
</Filter>
</ClInclude>
<ClInclude
Include=
"..\..\..\..\src\dish.hpp"
>
<Filter>
src\include
</Filter>
</ClInclude>
<ClInclude
Include=
"..\..\..\..\src\radio.hpp"
>
<Filter>
src\include
</Filter>
</ClInclude>
<ClInclude
Include=
"..\..\..\..\src\timers.hpp"
>
<Filter>
src\include
</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<Filter
Include=
"include"
>
...
...
doc/zmq_recv.txt
View file @
ffe4a1c6
...
...
@@ -19,7 +19,8 @@ by the 'socket' argument and store it in the buffer referenced by the 'buf'
argument. Any bytes exceeding the length specified by the 'len' argument shall
be truncated. If there are no messages available on the specified 'socket'
the _zmq_recv()_ function shall block until the request can be satisfied.
The 'flags' argument is a combination of the flags defined below:
The 'flags' argument is a combination of the flags defined below: The 'buf'
argument may be null if len is zero.
*ZMQ_DONTWAIT*::
Specifies that the operation should be performed in non-blocking mode. If there
...
...
src/dealer.cpp
View file @
ffe4a1c6
...
...
@@ -70,8 +70,7 @@ int zmq::dealer_t::xsetsockopt (int option_, const void *optval_,
size_t
optvallen_
)
{
bool
is_int
=
(
optvallen_
==
sizeof
(
int
));
int
value
=
0
;
if
(
is_int
)
memcpy
(
&
value
,
optval_
,
sizeof
(
int
));
int
value
=
is_int
?
*
((
int
*
)
optval_
)
:
0
;
switch
(
option_
)
{
case
ZMQ_PROBE_ROUTER
:
...
...
src/options.cpp
View file @
ffe4a1c6
...
...
@@ -92,8 +92,7 @@ int zmq::options_t::setsockopt (int option_, const void *optval_,
size_t
optvallen_
)
{
bool
is_int
=
(
optvallen_
==
sizeof
(
int
));
int
value
=
0
;
if
(
is_int
)
memcpy
(
&
value
,
optval_
,
sizeof
(
int
));
int
value
=
is_int
?
*
((
int
*
)
optval_
)
:
0
;
#if defined (ZMQ_ACT_MILITANT)
bool
malformed
=
true
;
// Did caller pass a bad option value?
#endif
...
...
src/req.cpp
View file @
ffe4a1c6
...
...
@@ -204,8 +204,8 @@ bool zmq::req_t::xhas_out ()
int
zmq
::
req_t
::
xsetsockopt
(
int
option_
,
const
void
*
optval_
,
size_t
optvallen_
)
{
bool
is_int
=
(
optvallen_
==
sizeof
(
int
));
int
value
=
0
;
if
(
is_int
)
memcpy
(
&
value
,
optval_
,
sizeof
(
int
));
int
value
=
is_int
?
*
((
int
*
)
optval_
)
:
0
;
switch
(
option_
)
{
case
ZMQ_REQ_CORRELATE
:
if
(
is_int
&&
value
>=
0
)
{
...
...
src/router.cpp
View file @
ffe4a1c6
...
...
@@ -97,8 +97,7 @@ int zmq::router_t::xsetsockopt (int option_, const void *optval_,
size_t
optvallen_
)
{
bool
is_int
=
(
optvallen_
==
sizeof
(
int
));
int
value
=
0
;
if
(
is_int
)
memcpy
(
&
value
,
optval_
,
sizeof
(
int
));
int
value
=
is_int
?
*
((
int
*
)
optval_
)
:
0
;
switch
(
option_
)
{
case
ZMQ_CONNECT_RID
:
...
...
src/stream.cpp
View file @
ffe4a1c6
...
...
@@ -178,8 +178,8 @@ int zmq::stream_t::xsetsockopt (int option_, const void *optval_,
size_t
optvallen_
)
{
bool
is_int
=
(
optvallen_
==
sizeof
(
int
));
int
value
=
0
;
if
(
is_int
)
memcpy
(
&
value
,
optval_
,
sizeof
(
int
));
int
value
=
is_int
?
*
((
int
*
)
optval_
)
:
0
;
switch
(
option_
)
{
case
ZMQ_CONNECT_RID
:
if
(
optval_
&&
optvallen_
)
{
...
...
src/sub.cpp
View file @
ffe4a1c6
...
...
@@ -62,9 +62,11 @@ int zmq::sub_t::xsetsockopt (int option_, const void *optval_,
else
if
(
option_
==
ZMQ_UNSUBSCRIBE
)
*
data
=
0
;
if
(
optvallen_
>
0
)
// We explicitly allow a NULL subscription with size zero
if
(
optvallen_
)
{
assert
(
optval_
);
memcpy
(
data
+
1
,
optval_
,
optvallen_
);
}
// Pass it further on in the stack.
int
err
=
0
;
rc
=
xsub_t
::
xsend
(
&
msg
);
...
...
src/xsub.cpp
View file @
ffe4a1c6
...
...
@@ -226,14 +226,18 @@ void zmq::xsub_t::send_subscription (unsigned char *data_, size_t size_,
{
pipe_t
*
pipe
=
(
pipe_t
*
)
arg_
;
// Create the subsc
t
ription message.
// Create the subscription message.
msg_t
msg
;
int
rc
=
msg
.
init_size
(
size_
+
1
);
errno_assert
(
rc
==
0
);
unsigned
char
*
data
=
(
unsigned
char
*
)
msg
.
data
();
data
[
0
]
=
1
;
if
(
size_
>
0
)
// We explicitly allow a NULL subscription with size zero
if
(
size_
)
{
assert
(
data_
);
memcpy
(
data
+
1
,
data_
,
size_
);
}
// Send it to the pipe.
bool
sent
=
pipe
->
write
(
&
msg
);
...
...
src/zmq.cpp
View file @
ffe4a1c6
...
...
@@ -390,14 +390,16 @@ int zmq_send (void *s_, const void *buf_, size_t len_, int flags_)
return
-
1
;
}
zmq_msg_t
msg
;
int
rc
=
zmq_msg_init_size
(
&
msg
,
len_
);
if
(
rc
!=
0
)
if
(
zmq_msg_init_size
(
&
msg
,
len_
))
return
-
1
;
if
(
len_
>
0
)
memcpy
(
zmq_msg_data
(
&
msg
),
buf_
,
len_
);
// We explicitly allow a send from NULL, size zero
if
(
len_
)
{
assert
(
buf_
);
memcpy
(
zmq_msg_data
(
&
msg
),
buf_
,
len_
);
}
zmq
::
socket_base_t
*
s
=
(
zmq
::
socket_base_t
*
)
s_
;
rc
=
s_sendmsg
(
s
,
&
msg
,
flags_
);
int
rc
=
s_sendmsg
(
s
,
&
msg
,
flags_
);
if
(
unlikely
(
rc
<
0
))
{
int
err
=
errno
;
int
rc2
=
zmq_msg_close
(
&
msg
);
...
...
@@ -517,12 +519,14 @@ int zmq_recv (void *s_, void *buf_, size_t len_, int flags_)
return
-
1
;
}
// At the moment an oversized message is silently truncated.
// TODO: Build in a notification mechanism to report the overflows.
// An oversized message is silently truncated.
size_t
to_copy
=
size_t
(
nbytes
)
<
len_
?
size_t
(
nbytes
)
:
len_
;
if
(
to_copy
>
0
)
memcpy
(
buf_
,
zmq_msg_data
(
&
msg
),
to_copy
);
// We explicitly allow a null buffer argument if len is zero
if
(
to_copy
)
{
assert
(
buf_
);
memcpy
(
buf_
,
zmq_msg_data
(
&
msg
),
to_copy
);
}
rc
=
zmq_msg_close
(
&
msg
);
errno_assert
(
rc
==
0
);
...
...
tests/test_msg_ffn.cpp
View file @
ffe4a1c6
...
...
@@ -27,12 +27,11 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "macros.hpp"
#include "testutil.hpp"
void
ffn
(
void
*
data
,
void
*
hint
)
{
LIBZMQ_UNUSED
(
data
);
// Signal that ffn has been called by writing "freed" to hint
(
void
)
data
;
// Suppress 'unused' warnings at compile time
memcpy
(
hint
,
(
void
*
)
"freed"
,
5
);
}
...
...
tests/test_timers.cpp
View file @
ffe4a1c6
...
...
@@ -27,7 +27,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "
macros
.hpp"
#include "
testutil
.hpp"
#if defined ZMQ_HAVE_WINDOWS
#include "windows.hpp"
...
...
@@ -50,7 +50,7 @@ void sleep_ (long timeout_)
void
handler
(
int
timer_id
,
void
*
arg
)
{
LIBZMQ_UNUSED
(
timer_id
);
(
void
)
timer_id
;
// Stop 'unused' compiler warnings
*
((
bool
*
)
arg
)
=
true
;
}
...
...
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