diff options
author | Martin Lucina <mato@kotelna.sk> | 2011-05-13 12:43:09 +0200 |
---|---|---|
committer | Martin Lucina <martin@lucina.net> | 2012-01-23 08:53:59 +0100 |
commit | ad3e013f74d309b86e8f087932203e5787fe2d2d (patch) | |
tree | a872da7e7338a0bb27b92ef1f198689873b86978 /src/xrep.cpp | |
parent | f34d1599a651dd0b8feba2397f87629733988384 (diff) | |
parent | b593ea30833ad5dcacb9076c988aec31b0cf26ec (diff) |
Imported Debian patch 2.1.7-1debian/2.1.7-1
Diffstat (limited to 'src/xrep.cpp')
-rw-r--r-- | src/xrep.cpp | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/xrep.cpp b/src/xrep.cpp index 75dc30e..7317056 100644 --- a/src/xrep.cpp +++ b/src/xrep.cpp @@ -63,7 +63,7 @@ void zmq::xrep_t::xattach_pipes (reader_t *inpipe_, writer_t *outpipe_, if (terminating) { register_term_acks (1); - outpipe_->terminate (); + outpipe_->terminate (); } } @@ -102,11 +102,13 @@ void zmq::xrep_t::terminated (reader_t *pipe_) for (inpipes_t::iterator it = inpipes.begin (); it != inpipes.end (); ++it) { if (it->reader == pipe_) { + if ((inpipes_t::size_type) (it - inpipes.begin ()) < current_in) + current_in--; inpipes.erase (it); - if (terminating) - unregister_term_ack (); if (current_in >= inpipes.size ()) current_in = 0; + if (terminating) + unregister_term_ack (); return; } } @@ -288,6 +290,16 @@ int zmq::xrep_t::xrecv (zmq_msg_t *msg_, int flags_) return -1; } +int zmq::xrep_t::rollback (void) +{ + if (current_out) { + current_out->rollback (); + current_out = NULL; + more_out = false; + } + return 0; +} + bool zmq::xrep_t::xhas_in () { // There are subsequent parts of the partly-read message available. |