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
12a97bb7
Commit
12a97bb7
authored
May 25, 2018
by
Simon Giesecke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Problem: redundant else after return
Solution: remove else
parent
21498700
Hide whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
155 additions
and
164 deletions
+155
-164
curve_client.cpp
src/curve_client.cpp
+1
-1
dish.cpp
src/dish.cpp
+49
-51
generic_mtrie_impl.hpp
src/generic_mtrie_impl.hpp
+6
-7
ip.cpp
src/ip.cpp
+10
-10
ip_resolver.cpp
src/ip_resolver.cpp
+4
-7
metadata.cpp
src/metadata.cpp
+2
-2
msg.cpp
src/msg.cpp
+2
-2
null_mechanism.cpp
src/null_mechanism.cpp
+5
-5
options.cpp
src/options.cpp
+4
-2
pipe.cpp
src/pipe.cpp
+1
-1
plain_client.cpp
src/plain_client.cpp
+1
-1
radio.cpp
src/radio.cpp
+5
-6
router.cpp
src/router.cpp
+27
-29
select.cpp
src/select.cpp
+8
-9
socks.cpp
src/socks.cpp
+9
-10
stream_engine.cpp
src/stream_engine.cpp
+2
-1
tcp_address.cpp
src/tcp_address.cpp
+4
-4
timers.cpp
src/timers.cpp
+2
-2
trie.cpp
src/trie.cpp
+7
-8
xsub.cpp
src/xsub.cpp
+2
-1
zap_client.cpp
src/zap_client.cpp
+1
-1
zmq.cpp
src/zmq.cpp
+3
-4
No files found.
src/curve_client.cpp
View file @
12a97bb7
...
...
@@ -125,7 +125,7 @@ zmq::mechanism_t::status_t zmq::curve_client_t::status () const
{
if
(
state
==
connected
)
return
mechanism_t
::
ready
;
else
if
(
state
==
error_received
)
if
(
state
==
error_received
)
return
mechanism_t
::
error
;
else
return
mechanism_t
::
handshaking
;
...
...
src/dish.cpp
View file @
12a97bb7
...
...
@@ -288,35 +288,34 @@ int zmq::dish_session_t::push_msg (msg_t *msg_)
int
rc
=
msg_
->
init
();
errno_assert
(
rc
==
0
);
return
0
;
}
else
{
const
char
*
group_setting
=
msg_
->
group
();
int
rc
;
if
(
group_setting
[
0
]
!=
0
)
goto
has_group
;
// Set the message group
rc
=
msg_
->
set_group
(
static_cast
<
char
*>
(
group_msg
.
data
()),
group_msg
.
size
());
errno_assert
(
rc
==
0
);
}
const
char
*
group_setting
=
msg_
->
group
();
int
rc
;
if
(
group_setting
[
0
]
!=
0
)
goto
has_group
;
// Set the message group
rc
=
msg_
->
set_group
(
static_cast
<
char
*>
(
group_msg
.
data
()),
group_msg
.
size
());
errno_assert
(
rc
==
0
);
// We set the group, so we don't need the group_msg anymore
rc
=
group_msg
.
close
();
errno_assert
(
rc
==
0
);
has_group
:
// Thread safe socket doesn't support multipart messages
if
((
msg_
->
flags
()
&
msg_t
::
more
)
==
msg_t
::
more
)
{
errno
=
EFAULT
;
return
-
1
;
}
// We set the group, so we don't need the group_msg anymore
rc
=
group_msg
.
close
();
errno_assert
(
rc
==
0
);
has_group
:
// Thread safe socket doesn't support multipart messages
if
((
msg_
->
flags
()
&
msg_t
::
more
)
==
msg_t
::
more
)
{
errno
=
EFAULT
;
return
-
1
;
}
// Push message to dish socket
rc
=
session_base_t
::
push_msg
(
msg_
);
// Push message to dish socket
rc
=
session_base_t
::
push_msg
(
msg_
);
if
(
rc
==
0
)
state
=
group
;
if
(
rc
==
0
)
state
=
group
;
return
rc
;
}
return
rc
;
}
int
zmq
::
dish_session_t
::
pull_msg
(
msg_t
*
msg_
)
...
...
@@ -328,38 +327,37 @@ int zmq::dish_session_t::pull_msg (msg_t *msg_)
if
(
!
msg_
->
is_join
()
&&
!
msg_
->
is_leave
())
return
rc
;
else
{
int
group_length
=
static_cast
<
int
>
(
strlen
(
msg_
->
group
()));
msg_t
command
;
int
offset
;
if
(
msg_
->
is_join
())
{
rc
=
command
.
init_size
(
group_length
+
5
);
errno_assert
(
rc
==
0
);
offset
=
5
;
memcpy
(
command
.
data
(),
"
\4
JOIN"
,
5
);
}
else
{
rc
=
command
.
init_size
(
group_length
+
6
);
errno_assert
(
rc
==
0
);
offset
=
6
;
memcpy
(
command
.
data
(),
"
\5
LEAVE"
,
6
);
}
command
.
set_flags
(
msg_t
::
command
);
char
*
command_data
=
static_cast
<
char
*>
(
command
.
data
());
int
group_length
=
static_cast
<
int
>
(
strlen
(
msg_
->
group
()));
// Copy the group
memcpy
(
command_data
+
offset
,
msg_
->
group
(),
group_length
)
;
msg_t
command
;
int
offset
;
// Close the join message
rc
=
msg_
->
close
(
);
if
(
msg_
->
is_join
())
{
rc
=
command
.
init_size
(
group_length
+
5
);
errno_assert
(
rc
==
0
);
offset
=
5
;
memcpy
(
command
.
data
(),
"
\4
JOIN"
,
5
);
}
else
{
rc
=
command
.
init_size
(
group_length
+
6
);
errno_assert
(
rc
==
0
);
offset
=
6
;
memcpy
(
command
.
data
(),
"
\5
LEAVE"
,
6
);
}
*
msg_
=
command
;
command
.
set_flags
(
msg_t
::
command
);
char
*
command_data
=
static_cast
<
char
*>
(
command
.
data
());
return
0
;
}
// Copy the group
memcpy
(
command_data
+
offset
,
msg_
->
group
(),
group_length
);
// Close the join message
rc
=
msg_
->
close
();
errno_assert
(
rc
==
0
);
*
msg_
=
command
;
return
0
;
}
void
zmq
::
dish_session_t
::
reset
()
...
...
src/generic_mtrie_impl.hpp
View file @
12a97bb7
...
...
@@ -140,14 +140,13 @@ bool zmq::generic_mtrie_t<T>::add_helper (prefix_t prefix_,
++
live_nodes
;
}
return
next
.
node
->
add_helper
(
prefix_
+
1
,
size_
-
1
,
pipe_
);
}
else
{
if
(
!
next
.
table
[
c
-
min
])
{
next
.
table
[
c
-
min
]
=
new
(
std
::
nothrow
)
generic_mtrie_t
;
alloc_assert
(
next
.
table
[
c
-
min
]);
++
live_nodes
;
}
return
next
.
table
[
c
-
min
]
->
add_helper
(
prefix_
+
1
,
size_
-
1
,
pipe_
);
}
if
(
!
next
.
table
[
c
-
min
])
{
next
.
table
[
c
-
min
]
=
new
(
std
::
nothrow
)
generic_mtrie_t
;
alloc_assert
(
next
.
table
[
c
-
min
]);
++
live_nodes
;
}
return
next
.
table
[
c
-
min
]
->
add_helper
(
prefix_
+
1
,
size_
-
1
,
pipe_
);
}
...
...
src/ip.cpp
View file @
12a97bb7
...
...
@@ -526,17 +526,17 @@ int zmq::make_fdpair (fd_t *r_, fd_t *w_)
if
(
*
r_
!=
INVALID_SOCKET
)
{
make_socket_noninheritable
(
*
r_
);
return
0
;
}
else
{
// Cleanup writer if connection failed
if
(
*
w_
!=
INVALID_SOCKET
)
{
rc
=
closesocket
(
*
w_
);
wsa_assert
(
rc
!=
SOCKET_ERROR
);
*
w_
=
INVALID_SOCKET
;
}
// Set errno from saved value
errno
=
wsa_error_to_errno
(
saved_errno
);
return
-
1
;
}
// Cleanup writer if connection failed
if
(
*
w_
!=
INVALID_SOCKET
)
{
rc
=
closesocket
(
*
w_
);
wsa_assert
(
rc
!=
SOCKET_ERROR
);
*
w_
=
INVALID_SOCKET
;
}
// Set errno from saved value
errno
=
wsa_error_to_errno
(
saved_errno
);
return
-
1
;
#elif defined ZMQ_HAVE_OPENVMS
...
...
src/ip_resolver.cpp
View file @
12a97bb7
...
...
@@ -31,19 +31,17 @@ bool zmq::ip_addr_t::is_multicast () const
// IPv4 Multicast: address MSBs are 1110
// Range: 224.0.0.0 - 239.255.255.255
return
IN_MULTICAST
(
ntohl
(
ipv4
.
sin_addr
.
s_addr
));
}
else
{
// IPv6 Multicast: ff00::/8
return
IN6_IS_ADDR_MULTICAST
(
&
ipv6
.
sin6_addr
)
!=
0
;
}
// IPv6 Multicast: ff00::/8
return
IN6_IS_ADDR_MULTICAST
(
&
ipv6
.
sin6_addr
)
!=
0
;
}
uint16_t
zmq
::
ip_addr_t
::
port
()
const
{
if
(
family
()
==
AF_INET6
)
{
return
ntohs
(
ipv6
.
sin6_port
);
}
else
{
return
ntohs
(
ipv4
.
sin_port
);
}
return
ntohs
(
ipv4
.
sin_port
);
}
const
struct
sockaddr
*
zmq
::
ip_addr_t
::
as_sockaddr
()
const
...
...
@@ -55,9 +53,8 @@ socklen_t zmq::ip_addr_t::sockaddr_len () const
{
if
(
family
()
==
AF_INET6
)
{
return
sizeof
(
ipv6
);
}
else
{
return
sizeof
(
ipv4
);
}
return
sizeof
(
ipv4
);
}
void
zmq
::
ip_addr_t
::
set_port
(
uint16_t
port_
)
...
...
src/metadata.cpp
View file @
12a97bb7
...
...
@@ -43,8 +43,8 @@ const char *zmq::metadata_t::get (const std::string &property_) const
return
get
(
ZMQ_MSG_PROPERTY_ROUTING_ID
);
return
NULL
;
}
else
return
it
->
second
.
c_str
();
}
return
it
->
second
.
c_str
();
}
void
zmq
::
metadata_t
::
add_ref
()
...
...
src/msg.cpp
View file @
12a97bb7
...
...
@@ -64,9 +64,9 @@ int zmq::msg_t::init (void *data_,
if
(
rc
!=
-
1
)
{
memcpy
(
data
(),
data_
,
size_
);
return
0
;
}
else
{
return
-
1
;
}
return
-
1
;
}
else
if
(
content_
)
{
return
init_external_storage
(
content_
,
data_
,
size_
,
ffn_
,
hint_
);
}
else
{
...
...
src/null_mechanism.cpp
View file @
12a97bb7
...
...
@@ -75,7 +75,8 @@ int zmq::null_mechanism_t::next_handshake_command (msg_t *msg_)
session
->
get_socket
()
->
event_handshake_failed_no_detail
(
session
->
get_endpoint
(),
EFAULT
);
return
-
1
;
}
else
if
(
rc
==
0
)
{
}
if
(
rc
==
0
)
{
send_zap_request
();
zap_request_sent
=
true
;
...
...
@@ -103,10 +104,9 @@ int zmq::null_mechanism_t::next_handshake_command (msg_t *msg_)
msg_data
[
6
]
=
status_code_len
;
memcpy
(
msg_data
+
7
,
status_code
.
c_str
(),
status_code_len
);
return
0
;
}
else
{
errno
=
EAGAIN
;
return
-
1
;
}
errno
=
EAGAIN
;
return
-
1
;
}
make_command_with_basic_properties
(
msg_
,
"
\5
READY"
,
6
);
...
...
@@ -203,7 +203,7 @@ zmq::mechanism_t::status_t zmq::null_mechanism_t::status () const
if
(
ready_command_sent
&&
ready_command_received
)
return
mechanism_t
::
ready
;
else
if
(
command_sent
&&
command_received
)
if
(
command_sent
&&
command_received
)
return
error
;
else
return
handshaking
;
...
...
src/options.cpp
View file @
12a97bb7
...
...
@@ -90,7 +90,8 @@ static int do_getsockopt_curve_key (void *const optval_,
if
(
*
optvallen_
==
CURVE_KEYSIZE
)
{
memcpy
(
optval_
,
curve_key_
,
CURVE_KEYSIZE
);
return
0
;
}
else
if
(
*
optvallen_
==
CURVE_KEYSIZE_Z85
+
1
)
{
}
if
(
*
optvallen_
==
CURVE_KEYSIZE_Z85
+
1
)
{
zmq_z85_encode
(
static_cast
<
char
*>
(
optval_
),
curve_key_
,
CURVE_KEYSIZE
);
return
0
;
...
...
@@ -150,7 +151,8 @@ do_setsockopt_string_allow_empty_strict (const void *const optval_,
if
(
optval_
==
NULL
&&
optvallen_
==
0
)
{
out_value_
->
clear
();
return
0
;
}
else
if
(
optval_
!=
NULL
&&
optvallen_
>
0
&&
optvallen_
<=
max_len_
)
{
}
if
(
optval_
!=
NULL
&&
optvallen_
>
0
&&
optvallen_
<=
max_len_
)
{
out_value_
->
assign
(
static_cast
<
const
char
*>
(
optval_
),
optvallen_
);
return
0
;
}
...
...
src/pipe.cpp
View file @
12a97bb7
...
...
@@ -404,7 +404,7 @@ void zmq::pipe_t::terminate (bool delay_)
}
// If the pipe is in the final phase of async termination, it's going to
// closed anyway. No need to do anything special here.
else
if
(
state
==
term_ack_sent
)
{
if
(
state
==
term_ack_sent
)
{
return
;
}
// The simple sync termination case. Ask the peer to terminate and wait
...
...
src/plain_client.cpp
View file @
12a97bb7
...
...
@@ -104,7 +104,7 @@ zmq::mechanism_t::status_t zmq::plain_client_t::status () const
{
if
(
state
==
ready
)
return
mechanism_t
::
ready
;
else
if
(
state
==
error_command_received
)
if
(
state
==
error_command_received
)
return
mechanism_t
::
error
;
else
return
mechanism_t
::
handshaking
;
...
...
src/radio.cpp
View file @
12a97bb7
...
...
@@ -240,8 +240,8 @@ int zmq::radio_session_t::push_msg (msg_t *msg_)
// Push the join or leave command
*
msg_
=
join_leave_msg
;
return
session_base_t
::
push_msg
(
msg_
);
}
else
return
session_base_t
::
push_msg
(
msg_
);
}
return
session_base_t
::
push_msg
(
msg_
);
}
int
zmq
::
radio_session_t
::
pull_msg
(
msg_t
*
msg_
)
...
...
@@ -263,11 +263,10 @@ int zmq::radio_session_t::pull_msg (msg_t *msg_)
// Next status is the body
state
=
body
;
return
0
;
}
else
{
*
msg_
=
pending_msg
;
state
=
group
;
return
0
;
}
*
msg_
=
pending_msg
;
state
=
group
;
return
0
;
}
void
zmq
::
radio_session_t
::
reset
()
...
...
src/router.cpp
View file @
12a97bb7
...
...
@@ -507,35 +507,33 @@ bool zmq::router_t::identify_peer (pipe_t *pipe_)
if
(
!
handover
)
// Ignore peers with duplicate ID
return
false
;
else
{
// We will allow the new connection to take over this
// routing id. Temporarily assign a new routing id to the
// existing pipe so we can terminate it asynchronously.
unsigned
char
buf
[
5
];
buf
[
0
]
=
0
;
put_uint32
(
buf
+
1
,
next_integral_routing_id
++
);
blob_t
new_routing_id
(
buf
,
sizeof
buf
);
it
->
second
.
pipe
->
set_router_socket_routing_id
(
new_routing_id
);
outpipe_t
existing_outpipe
=
{
it
->
second
.
pipe
,
it
->
second
.
active
};
ok
=
outpipes
.
ZMQ_MAP_INSERT_OR_EMPLACE
(
ZMQ_MOVE
(
new_routing_id
),
existing_outpipe
)
.
second
;
zmq_assert
(
ok
);
// Remove the existing routing id entry to allow the new
// connection to take the routing id.
outpipes
.
erase
(
it
);
if
(
existing_outpipe
.
pipe
==
current_in
)
terminate_current_in
=
true
;
else
existing_outpipe
.
pipe
->
terminate
(
true
);
}
// We will allow the new connection to take over this
// routing id. Temporarily assign a new routing id to the
// existing pipe so we can terminate it asynchronously.
unsigned
char
buf
[
5
];
buf
[
0
]
=
0
;
put_uint32
(
buf
+
1
,
next_integral_routing_id
++
);
blob_t
new_routing_id
(
buf
,
sizeof
buf
);
it
->
second
.
pipe
->
set_router_socket_routing_id
(
new_routing_id
);
outpipe_t
existing_outpipe
=
{
it
->
second
.
pipe
,
it
->
second
.
active
};
ok
=
outpipes
.
ZMQ_MAP_INSERT_OR_EMPLACE
(
ZMQ_MOVE
(
new_routing_id
),
existing_outpipe
)
.
second
;
zmq_assert
(
ok
);
// Remove the existing routing id entry to allow the new
// connection to take the routing id.
outpipes
.
erase
(
it
);
if
(
existing_outpipe
.
pipe
==
current_in
)
terminate_current_in
=
true
;
else
existing_outpipe
.
pipe
->
terminate
(
true
);
}
}
}
...
...
src/select.cpp
View file @
12a97bb7
...
...
@@ -583,15 +583,14 @@ u_short zmq::select_t::determine_fd_family (fd_t fd_)
if
(
rc
==
0
)
{
if
(
type
==
SOCK_DGRAM
)
return
AF_INET
;
else
{
rc
=
getsockname
(
fd_
,
reinterpret_cast
<
sockaddr
*>
(
&
addr
),
&
addr_size
);
// AF_INET and AF_INET6 can be mixed in select
// TODO: If proven otherwise, should simply return addr.sa_family
if
(
rc
!=
SOCKET_ERROR
)
return
addr
.
ss_family
==
AF_INET6
?
AF_INET
:
addr
.
ss_family
;
}
rc
=
getsockname
(
fd_
,
reinterpret_cast
<
sockaddr
*>
(
&
addr
),
&
addr_size
);
// AF_INET and AF_INET6 can be mixed in select
// TODO: If proven otherwise, should simply return addr.sa_family
if
(
rc
!=
SOCKET_ERROR
)
return
addr
.
ss_family
==
AF_INET6
?
AF_INET
:
addr
.
ss_family
;
}
return
AF_UNSPEC
;
...
...
src/socks.cpp
View file @
12a97bb7
...
...
@@ -266,16 +266,15 @@ bool zmq::socks_response_decoder_t::message_ready () const
{
if
(
bytes_read
<
4
)
return
false
;
else
{
const
uint8_t
atyp
=
buf
[
3
];
zmq_assert
(
atyp
==
0x01
||
atyp
==
0x03
||
atyp
==
0x04
);
if
(
atyp
==
0x01
)
return
bytes_read
==
10
;
else
if
(
atyp
==
0x03
)
return
bytes_read
>
4
&&
bytes_read
==
4
+
1
+
buf
[
4
]
+
2u
;
else
return
bytes_read
==
22
;
}
const
uint8_t
atyp
=
buf
[
3
];
zmq_assert
(
atyp
==
0x01
||
atyp
==
0x03
||
atyp
==
0x04
);
if
(
atyp
==
0x01
)
return
bytes_read
==
10
;
if
(
atyp
==
0x03
)
return
bytes_read
>
4
&&
bytes_read
==
4
+
1
+
buf
[
4
]
+
2u
;
else
return
bytes_read
==
22
;
}
zmq
::
socks_response_t
zmq
::
socks_response_decoder_t
::
decode
()
...
...
src/stream_engine.cpp
View file @
12a97bb7
...
...
@@ -770,7 +770,8 @@ int zmq::stream_engine_t::next_handshake_command (msg_t *msg_)
if
(
mechanism
->
status
()
==
mechanism_t
::
ready
)
{
mechanism_ready
();
return
pull_and_encode
(
msg_
);
}
else
if
(
mechanism
->
status
()
==
mechanism_t
::
error
)
{
}
if
(
mechanism
->
status
()
==
mechanism_t
::
error
)
{
errno
=
EPROTO
;
return
-
1
;
}
else
{
...
...
src/tcp_address.cpp
View file @
12a97bb7
...
...
@@ -153,8 +153,8 @@ socklen_t zmq::tcp_address_t::addrlen () const
{
if
(
address
.
generic
.
sa_family
==
AF_INET6
)
return
static_cast
<
socklen_t
>
(
sizeof
(
address
.
ipv6
));
else
return
static_cast
<
socklen_t
>
(
sizeof
(
address
.
ipv4
));
return
static_cast
<
socklen_t
>
(
sizeof
(
address
.
ipv4
));
}
const
sockaddr
*
zmq
::
tcp_address_t
::
src_addr
()
const
...
...
@@ -166,8 +166,8 @@ socklen_t zmq::tcp_address_t::src_addrlen () const
{
if
(
address
.
family
()
==
AF_INET6
)
return
static_cast
<
socklen_t
>
(
sizeof
(
source_address
.
ipv6
));
else
return
static_cast
<
socklen_t
>
(
sizeof
(
source_address
.
ipv4
));
return
static_cast
<
socklen_t
>
(
sizeof
(
source_address
.
ipv4
));
}
bool
zmq
::
tcp_address_t
::
has_src_addr
()
const
...
...
src/timers.cpp
View file @
12a97bb7
...
...
@@ -147,8 +147,8 @@ long zmq::timers_t::timeout ()
if
(
cancelled_it
==
cancelled_timers
.
end
())
{
if
(
it
->
first
>
now
)
return
static_cast
<
long
>
(
it
->
first
-
now
);
else
return
0
;
return
0
;
}
// Let's remove it from the beginning of the list
...
...
src/trie.cpp
View file @
12a97bb7
...
...
@@ -114,15 +114,14 @@ bool zmq::trie_t::add (unsigned char *prefix_, size_t size_)
zmq_assert
(
live_nodes
==
1
);
}
return
next
.
node
->
add
(
prefix_
+
1
,
size_
-
1
);
}
else
{
if
(
!
next
.
table
[
c
-
min
])
{
next
.
table
[
c
-
min
]
=
new
(
std
::
nothrow
)
trie_t
;
alloc_assert
(
next
.
table
[
c
-
min
]);
++
live_nodes
;
zmq_assert
(
live_nodes
>
1
);
}
return
next
.
table
[
c
-
min
]
->
add
(
prefix_
+
1
,
size_
-
1
);
}
if
(
!
next
.
table
[
c
-
min
])
{
next
.
table
[
c
-
min
]
=
new
(
std
::
nothrow
)
trie_t
;
alloc_assert
(
next
.
table
[
c
-
min
]);
++
live_nodes
;
zmq_assert
(
live_nodes
>
1
);
}
return
next
.
table
[
c
-
min
]
->
add
(
prefix_
+
1
,
size_
-
1
);
}
bool
zmq
::
trie_t
::
rm
(
unsigned
char
*
prefix_
,
size_t
size_
)
...
...
src/xsub.cpp
View file @
12a97bb7
...
...
@@ -104,7 +104,8 @@ int zmq::xsub_t::xsend (msg_t *msg_)
// when there are forwarding devices involved.
subscriptions
.
add
(
data
+
1
,
size
-
1
);
return
dist
.
send_to_all
(
msg_
);
}
else
if
(
size
>
0
&&
*
data
==
0
)
{
}
if
(
size
>
0
&&
*
data
==
0
)
{
// Process unsubscribe message
if
(
subscriptions
.
rm
(
data
+
1
,
size
-
1
))
return
dist
.
send_to_all
(
msg_
);
...
...
src/zap_client.cpp
View file @
12a97bb7
...
...
@@ -263,7 +263,7 @@ zmq::mechanism_t::status_t zap_client_common_handshake_t::status () const
{
if
(
state
==
ready
)
return
mechanism_t
::
ready
;
else
if
(
state
==
error_sent
)
if
(
state
==
error_sent
)
return
mechanism_t
::
error
;
else
return
mechanism_t
::
handshaking
;
...
...
src/zmq.cpp
View file @
12a97bb7
...
...
@@ -685,10 +685,9 @@ const char *zmq_msg_gets (const zmq_msg_t *msg_, const char *property_)
value
=
metadata
->
get
(
std
::
string
(
property_
));
if
(
value
)
return
value
;
else
{
errno
=
EINVAL
;
return
NULL
;
}
errno
=
EINVAL
;
return
NULL
;
}
// Polling.
...
...
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