Commit 0feec7a7 authored by Constantin Rack's avatar Constantin Rack

Merge pull request #1881 from camachat/master

Fixes #1419 segfault when using a XSUB/XPUB proxy.
parents a7922e5f 023b34a1
......@@ -124,12 +124,14 @@ void zmq::dist_t::pipe_terminated (pipe_t *pipe_)
void zmq::dist_t::activated (pipe_t *pipe_)
{
// Move the pipe from passive to eligible state.
pipes.swap (pipes.index (pipe_), eligible);
eligible++;
if (eligible < pipes.size ()) {
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) {
if (!more && active < pipes.size ()) {
pipes.swap (eligible - 1, active);
active++;
}
......
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