summaryrefslogtreecommitdiff
path: root/src/router.cpp
diff options
context:
space:
mode:
authorMartin Sustrik <sustrik@250bpm.com>2011-09-28 08:03:14 +0200
committerMartin Sustrik <sustrik@250bpm.com>2011-09-28 08:03:14 +0200
commit8485a5e5a4cdcb5cec800279f874c8579d246940 (patch)
tree52abacfc5ba45d366d60c9666a1d78dcf25843c8 /src/router.cpp
parentd726120e60e3db332ed26c2106c65271f4d8fba4 (diff)
Assert fixed in XREP & ROUTER when sending to terminating pipe (issue 258)
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
Diffstat (limited to 'src/router.cpp')
-rwxr-xr-xsrc/router.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/router.cpp b/src/router.cpp
index c8cc278..05908b5 100755
--- a/src/router.cpp
+++ b/src/router.cpp
@@ -179,8 +179,9 @@ int zmq::router_t::xsend (msg_t *msg_, int flags_)
// Push the message into the pipe. If there's no out pipe, just drop it.
if (current_out) {
bool ok = current_out->write (msg_);
- zmq_assert (ok);
- if (!more_out) {
+ if (unlikely (!ok))
+ current_out = NULL;
+ else if (!more_out) {
current_out->flush ();
current_out = NULL;
}