Commit c42343d3 authored by Martin Sustrik's avatar Martin Sustrik

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

parent dcb98369
...@@ -170,6 +170,10 @@ void zmq::writer_t::rollback () ...@@ -170,6 +170,10 @@ void zmq::writer_t::rollback ()
zmq_msg_t msg; zmq_msg_t msg;
while (pipe->unwrite (&msg)) { while (pipe->unwrite (&msg)) {
if (!(msg.flags & ZMQ_MSG_TBC)) {
pipe->write (msg);
break;
}
zmq_msg_close (&msg); zmq_msg_close (&msg);
msgs_written--; msgs_written--;
} }
......
...@@ -98,7 +98,7 @@ namespace zmq ...@@ -98,7 +98,7 @@ namespace zmq
// message cannot be written because high watermark was reached. // message cannot be written because high watermark was reached.
bool write (zmq_msg_t *msg_); bool write (zmq_msg_t *msg_);
// Remove any unflushed messages from the pipe. // Remove unfinished part of a message from the pipe.
void rollback (); void rollback ();
// Flush the messages downsteam. // Flush the messages downsteam.
......
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