[zeromq-dev] the reason for zmq_assert (fetched);
hamster
YIDIEPXGXGPN at spammotel.com
Wed Aug 4 17:13:46 CEST 2010
Hello!
Martin Lucina <mato <at> kotelna.sk> writes:
> Also, hamster, it'd help if you send actual patches (output of git diff)
> to the mailing list, that way it's easier to see the change straight away.
Below is the git diff output:
=======================================================
diff --git a/src/xrep.cpp b/src/xrep.cpp
index 978ed0b..cda8323 100644
--- a/src/xrep.cpp
+++ b/src/xrep.cpp
@@ -187,14 +187,15 @@ 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 (prefetched) {
- zmq_msg_move (msg_, &prefetched_msg);
+ zmq_msg_move (msg_, &prefetched_msg); // zmq_msg_close (msg_); inside
more_in = msg_->flags & ZMQ_MSG_MORE;
prefetched = false;
return 0;
+ } else {
+ // 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.
=======================================================
More information about the zeromq-dev
mailing list