Commit 6ecec9bb authored by Martin Sustrik's avatar Martin Sustrik

Current inpipe remains unchaged in XREP when other pipe terminates

When an inpipe terminated within XREP, it was erased from the array
and thus current_in (which is an index) pointed to a different
element in the array. This caused problems when we were in the
middle of reading a multipart message.
Signed-off-by: 's avatarMartin Sustrik <sustrik@250bpm.com>
parent e5d4cd39
...@@ -101,10 +101,10 @@ void zmq::xrep_t::terminated (reader_t *pipe_) ...@@ -101,10 +101,10 @@ void zmq::xrep_t::terminated (reader_t *pipe_)
++it) { ++it) {
if (it->reader == pipe_) { if (it->reader == pipe_) {
inpipes.erase (it); inpipes.erase (it);
if ((inpipes_t::size_type) (it - inpipes.begin ()) < current_in)
current_in--;
if (terminating) if (terminating)
unregister_term_ack (); unregister_term_ack ();
if (current_in >= inpipes.size ())
current_in = 0;
return; return;
} }
} }
......
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