summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPieter Hintjens <ph@imatix.com>2010-08-20 01:06:34 +0200
committerPieter Hintjens <ph@imatix.com>2010-08-20 01:06:34 +0200
commit87612be91d4ff5252613196f061bd89d3bce25ec (patch)
treec037d9f6236606f9d065ca26a1cc0ae2a3a891f2
parentde0035b6d9fc1c5423d10fbac468b0e17188510f (diff)
parent5be54b912029381736ee8b8798f95cc9a2544a70 (diff)
Merge branch '46_device_robustness'
-rw-r--r--src/xrep.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/xrep.cpp b/src/xrep.cpp
index 978ed0b..5fd6cbb 100644
--- a/src/xrep.cpp
+++ b/src/xrep.cpp
@@ -143,8 +143,11 @@ int zmq::xrep_t::xsend (zmq_msg_t *msg_, int flags_)
if (!more_out) {
zmq_assert (!current_out);
- // There's no such thing as prefix with no subsequent message.
- zmq_assert (msg_->flags & ZMQ_MSG_MORE);
+ // If we have malformed message (prefix with no subsequent message)
+ // then just silently drop the message.
+ if ((msg_->flags & ZMQ_MSG_MORE) == 0)
+ return 0;
+
more_out = true;
// Find the pipe associated with the identity stored in the prefix.
@@ -154,7 +157,7 @@ int zmq::xrep_t::xsend (zmq_msg_t *msg_, int flags_)
outpipes_t::iterator it = outpipes.find (identity);
if (it == outpipes.end ())
return 0;
-
+
// Remember the outgoing pipe.
current_out = it->second.writer;