0
0
mirror of https://github.com/zeromq/libzmq.git synced 2025-01-04 04:55:27 +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:
Martin Sustrik 2011-05-02 19:26:30 +02:00
parent e78cc47b18
commit e5d4cd39e1

View File

@ -90,17 +90,15 @@ void zmq::dist_t::terminated (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
// into the list of eligible pipes. Otherwise we add it to the list
// of active pipes.
if (more) {
pipes.swap (pipes.index (pipe_), eligible);
eligible++;
}
else {
pipes.swap (pipes.index (pipe_), active);
// Move the pipe from passive to eligible state.
pipes.swap (pipes.index (pipe_), eligible);
eligible++;
// If there's no message being sent at the moment, move it to
// the active state.
if (!more) {
pipes.swap (eligible - 1, active);
active++;
eligible++;
}
}