Commit e5d4cd39 authored by Martin Sustrik's avatar Martin Sustrik

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: 's avatarMartin Sustrik <sustrik@250bpm.com>
parent e78cc47b
...@@ -90,17 +90,15 @@ void zmq::dist_t::terminated (writer_t *pipe_) ...@@ -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 pipes.swap (pipes.index (pipe_), eligible);
// of active pipes. eligible++;
if (more) {
pipes.swap (pipes.index (pipe_), eligible); // If there's no message being sent at the moment, move it to
eligible++; // the active state.
} if (!more) {
else { pipes.swap (eligible - 1, active);
pipes.swap (pipes.index (pipe_), active);
active++; active++;
eligible++;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment