pipe_t::rollback removes only unfinished message from the pipe rather than all unflushed messages

This commit is contained in:
Martin Sustrik 2010-03-13 12:34:55 +01:00
parent dcb983699e
commit c42343d3f0
2 changed files with 5 additions and 1 deletions

View File

@ -170,6 +170,10 @@ void zmq::writer_t::rollback ()
zmq_msg_t msg;
while (pipe->unwrite (&msg)) {
if (!(msg.flags & ZMQ_MSG_TBC)) {
pipe->write (msg);
break;
}
zmq_msg_close (&msg);
msgs_written--;
}

View File

@ -98,7 +98,7 @@ namespace zmq
// message cannot be written because high watermark was reached.
bool write (zmq_msg_t *msg_);
// Remove any unflushed messages from the pipe.
// Remove unfinished part of a message from the pipe.
void rollback ();
// Flush the messages downsteam.