summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Sustrik <sustrik@250bpm.com>2010-02-07 11:31:05 +0100
committerMartin Sustrik <sustrik@250bpm.com>2010-02-07 11:31:05 +0100
commitb0ee6b0c8ab8a5052a5e111dda24308dd00c0d62 (patch)
tree6abffa8a89e3f775afe1daacb59f6ee95e938376
parentbbaa494fb569d94c356ddecca7dbf249ffc217cf (diff)
ZMQII-62: zmq_close after sending message via P2P socket fails
-rw-r--r--src/p2p.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/p2p.cpp b/src/p2p.cpp
index 9a5e186..72bc26b 100644
--- a/src/p2p.cpp
+++ b/src/p2p.cpp
@@ -93,6 +93,11 @@ int zmq::p2p_t::xsend (zmq_msg_t *msg_, int flags_)
outpipe->write (msg_);
if (!(flags_ & ZMQ_NOFLUSH))
outpipe->flush ();
+
+ // Detach the original message from the data buffer.
+ int rc = zmq_msg_init (msg_);
+ zmq_assert (rc == 0);
+
return 0;
}