Skip to content

Commit

Permalink
Another fix to PUB sockets with multipart messages
Browse files Browse the repository at this point in the history
  • Loading branch information
hintjens committed Apr 30, 2011
1 parent bd7f249 commit 9bd6bf5
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions src/dist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,17 +92,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 new 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++;
}
}

Expand Down

0 comments on commit 9bd6bf5

Please sign in to comment.