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
5b510656
Commit
5b510656
authored
Feb 02, 2018
by
sigiesec
Committed by
Simon Giesecke
Feb 08, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Problem: unreachable code around socket_base_t::add/remove_signaler
Solution: replaced by assertion
parent
b77d7610
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
26 deletions
+13
-26
socket_base.cpp
src/socket_base.cpp
+10
-22
socket_base.hpp
src/socket_base.hpp
+2
-2
socket_poller.cpp
src/socket_poller.cpp
+1
-2
No files found.
src/socket_base.cpp
View file @
5b510656
...
...
@@ -312,9 +312,9 @@ int zmq::socket_base_t::check_protocol (const std::string &protocol_)
return
-
1
;
}
// Check whether socket type and transport protocol match.
// Specifically, multicast protocols can't be combined with
// bi-directional messaging patterns (socket types).
// Check whether socket type and transport protocol match.
// Specifically, multicast protocols can't be combined with
// bi-directional messaging patterns (socket types).
#if defined ZMQ_HAVE_OPENPGM || defined ZMQ_HAVE_NORM
if
((
protocol_
==
"pgm"
||
protocol_
==
"epgm"
||
protocol_
==
"norm"
)
&&
options
.
type
!=
ZMQ_PUB
&&
options
.
type
!=
ZMQ_SUB
...
...
@@ -487,32 +487,20 @@ int zmq::socket_base_t::leave (const char *group_)
return
rc
;
}
int
zmq
::
socket_base_t
::
add_signaler
(
signaler_t
*
s_
)
void
zmq
::
socket_base_t
::
add_signaler
(
signaler_t
*
s_
)
{
scoped_optional_lock_t
sync_lock
(
thread_safe
?
&
sync
:
NULL
);
if
(
!
thread_safe
)
{
errno
=
EINVAL
;
return
-
1
;
}
zmq_assert
(
thread_safe
);
scoped_lock_t
sync_lock
(
sync
);
((
mailbox_safe_t
*
)
mailbox
)
->
add_signaler
(
s_
);
return
0
;
}
int
zmq
::
socket_base_t
::
remove_signaler
(
signaler_t
*
s_
)
void
zmq
::
socket_base_t
::
remove_signaler
(
signaler_t
*
s_
)
{
scoped_optional_lock_t
sync_lock
(
thread_safe
?
&
sync
:
NULL
);
if
(
!
thread_safe
)
{
errno
=
EINVAL
;
return
-
1
;
}
zmq_assert
(
thread_safe
);
scoped_lock_t
sync_lock
(
sync
);
((
mailbox_safe_t
*
)
mailbox
)
->
remove_signaler
(
s_
);
return
0
;
}
int
zmq
::
socket_base_t
::
bind
(
const
char
*
addr_
)
...
...
@@ -923,7 +911,7 @@ int zmq::socket_base_t::connect (const char *addr_)
}
}
// TBD - Should we check address for ZMQ_HAVE_NORM???
// TBD - Should we check address for ZMQ_HAVE_NORM???
#ifdef ZMQ_HAVE_OPENPGM
if
(
protocol
==
"pgm"
||
protocol
==
"epgm"
)
{
...
...
src/socket_base.hpp
View file @
5b510656
...
...
@@ -86,8 +86,8 @@ class socket_base_t : public own_t,
int
term_endpoint
(
const
char
*
addr_
);
int
send
(
zmq
::
msg_t
*
msg_
,
int
flags_
);
int
recv
(
zmq
::
msg_t
*
msg_
,
int
flags_
);
int
add_signaler
(
signaler_t
*
s
);
int
remove_signaler
(
signaler_t
*
s
);
void
add_signaler
(
signaler_t
*
s
);
void
remove_signaler
(
signaler_t
*
s
);
int
close
();
// These functions are used by the polling mechanism to determine
...
...
src/socket_poller.cpp
View file @
5b510656
...
...
@@ -130,8 +130,7 @@ int zmq::socket_poller_t::add (socket_base_t *socket_,
}
}
rc
=
socket_
->
add_signaler
(
signaler
);
zmq_assert
(
rc
==
0
);
socket_
->
add_signaler
(
signaler
);
}
item_t
item
=
{
...
...
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