diff options
author | Martin Lucina <mato@kotelna.sk> | 2010-10-21 16:21:20 +0200 |
---|---|---|
committer | Martin Lucina <martin@lucina.net> | 2012-01-23 08:53:31 +0100 |
commit | 3f0085ddbef1a44b6bb7a0b23af497d56e0025fa (patch) | |
tree | 0adac3a5b31b2a1d9a89ec5a797f34c1a3fdf27a /src/xrep.cpp | |
parent | 90d73cba9cd1d1724f38ed82fc0eefb1781c9c20 (diff) | |
parent | 2c416a793ea781273a5da6742211f5f01af13a2b (diff) |
Imported Debian patch 2.0.10-1debian/2.0.10-1
Diffstat (limited to 'src/xrep.cpp')
-rw-r--r-- | src/xrep.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/xrep.cpp b/src/xrep.cpp index 5fd6cbb..f50e32e 100644 --- a/src/xrep.cpp +++ b/src/xrep.cpp @@ -190,9 +190,7 @@ int zmq::xrep_t::xsend (zmq_msg_t *msg_, int flags_) int zmq::xrep_t::xrecv (zmq_msg_t *msg_, int flags_) { - // Deallocate old content of the message. - zmq_msg_close (msg_); - + // If there is a prefetched message, return it. if (prefetched) { zmq_msg_move (msg_, &prefetched_msg); more_in = msg_->flags & ZMQ_MSG_MORE; @@ -200,6 +198,9 @@ int zmq::xrep_t::xrecv (zmq_msg_t *msg_, int flags_) return 0; } + // Deallocate old content of the message. + zmq_msg_close (msg_); + // If we are in the middle of reading a message, just grab next part of it. if (more_in) { zmq_assert (inpipes [current_in].active); |