mirror of
https://github.com/zeromq/libzmq.git
synced 2025-01-21 15:12:03 +08:00
Yet one more fix related to PUB socket and multipart messages
This patch fixes the activation of the pipes, when they pass from passive state directly to active. Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
This commit is contained in:
parent
e78cc47b18
commit
e5d4cd39e1
14
src/dist.cpp
14
src/dist.cpp
@ -90,17 +90,15 @@ void zmq::dist_t::terminated (writer_t *pipe_)
|
|||||||
|
|
||||||
void zmq::dist_t::activated (writer_t *pipe_)
|
void zmq::dist_t::activated (writer_t *pipe_)
|
||||||
{
|
{
|
||||||
// If we are in the middle of sending a message, we'll add the pipe
|
// Move the pipe from passive to eligible state.
|
||||||
// into the list of eligible pipes. Otherwise we add it to the list
|
|
||||||
// of active pipes.
|
|
||||||
if (more) {
|
|
||||||
pipes.swap (pipes.index (pipe_), eligible);
|
pipes.swap (pipes.index (pipe_), eligible);
|
||||||
eligible++;
|
eligible++;
|
||||||
}
|
|
||||||
else {
|
// If there's no message being sent at the moment, move it to
|
||||||
pipes.swap (pipes.index (pipe_), active);
|
// the active state.
|
||||||
|
if (!more) {
|
||||||
|
pipes.swap (eligible - 1, active);
|
||||||
active++;
|
active++;
|
||||||
eligible++;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user