Commit 8ec747e1 authored by Nikhil Mishra's avatar Nikhil Mishra

Issue 1588 : Rollback in case send fails for multipart msg

parent cca67fdd
...@@ -107,7 +107,17 @@ int zmq::lb_t::sendpipe (msg_t *msg_, pipe_t **pipe_) ...@@ -107,7 +107,17 @@ int zmq::lb_t::sendpipe (msg_t *msg_, pipe_t **pipe_)
break; break;
} }
zmq_assert (!more); // If send fails for multi-part msg rollback other
// parts sent earlier and return EAGAIN.
// Application should handle this as suitable
if (more)
{
pipes [current]->rollback ();
more = 0;
errno = EAGAIN;
return -1;
}
active--; active--;
if (current < active) if (current < active)
pipes.swap (current, active); pipes.swap (current, active);
......
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