mirror of
https://github.com/zeromq/libzmq.git
synced 2025-03-03 12:58:05 +01:00
Merge pull request #431 from ipechorin/master
Forward-port fix for LIBZMQ-211
This commit is contained in:
commit
343ec62282
24
src/rep.cpp
24
src/rep.cpp
@ -72,12 +72,24 @@ int zmq::rep_t::xrecv (msg_t *msg_, int flags_)
|
|||||||
int rc = router_t::xrecv (msg_, flags_);
|
int rc = router_t::xrecv (msg_, flags_);
|
||||||
if (rc != 0)
|
if (rc != 0)
|
||||||
return rc;
|
return rc;
|
||||||
zmq_assert (msg_->flags () & msg_t::more);
|
|
||||||
bool bottom = (msg_->size () == 0);
|
if ((msg_->flags () & msg_t::more)) {
|
||||||
rc = router_t::xsend (msg_, flags_);
|
// Empty message part delimits the traceback stack.
|
||||||
errno_assert (rc == 0);
|
bool bottom = (msg_->size () == 0);
|
||||||
if (bottom)
|
|
||||||
break;
|
// Push it to the reply pipe.
|
||||||
|
rc = router_t::xsend (msg_, flags_);
|
||||||
|
errno_assert (rc == 0);
|
||||||
|
|
||||||
|
if (bottom)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// If the traceback stack is malformed, discard anything
|
||||||
|
// already sent to pipe (we're at end of invalid message).
|
||||||
|
rc = router_t::rollback ();
|
||||||
|
errno_assert (rc == 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
request_begins = false;
|
request_begins = false;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user