Skip to content
This repository has been archived by the owner on Nov 20, 2020. It is now read-only.

Commit

Permalink
Merge pull request zeromq#99 from leewoosung/hotfixes/patched
Browse files Browse the repository at this point in the history
Backport for LIBZMQ-541 fix
  • Loading branch information
hintjens committed Jul 15, 2013
2 parents 00c0d58 + 1b5b18c commit 2aca7b2
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/dist.cpp
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,19 @@ void zmq::dist_t::terminated (pipe_t *pipe_)
{
// Remove the pipe from the list; adjust number of matching, active and/or
// eligible pipes accordingly.
if (pipes.index (pipe_) < matching)
if (pipes.index (pipe_) < matching) {
pipes.swap (pipes.index (pipe_), matching - 1);
matching--;
if (pipes.index (pipe_) < active)
}
if (pipes.index (pipe_) < active) {
pipes.swap (pipes.index (pipe_), active - 1);
active--;
if (pipes.index (pipe_) < eligible)
}
if (pipes.index (pipe_) < eligible) {
pipes.swap (pipes.index (pipe_), eligible - 1);
eligible--;
}

pipes.erase (pipe_);
}

Expand Down

0 comments on commit 2aca7b2

Please sign in to comment.