mirror of
https://github.com/zeromq/libzmq.git
synced 2025-01-07 21:05:34 +08:00
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: Martin Sustrik <sustrik@250bpm.com>
This commit is contained in:
parent
e5d4cd39e1
commit
6ecec9bbf1
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user