summaryrefslogtreecommitdiff
path: root/src/xrep.cpp
diff options
context:
space:
mode:
authorMartin Sustrik <sustrik@250bpm.com>2011-09-03 07:40:49 +0200
committerMartin Sustrik <sustrik@250bpm.com>2011-09-03 07:40:49 +0200
commit9fb9fea63351cff0e664b28636acb3c3e1f84721 (patch)
treef94af51170fc3179e2f362792fee67c219d8f3de /src/xrep.cpp
parent8b7ac4c2a9c3ede95d6f5f9717a1939a23788964 (diff)
Improve error reporting in a minor way
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
Diffstat (limited to 'src/xrep.cpp')
-rw-r--r--src/xrep.cpp31
1 files changed, 16 insertions, 15 deletions
diff --git a/src/xrep.cpp b/src/xrep.cpp
index 9b57435..a11b8c1 100644
--- a/src/xrep.cpp
+++ b/src/xrep.cpp
@@ -130,22 +130,23 @@ int zmq::xrep_t::xsend (msg_t *msg_, int flags_)
// Find the pipe associated with the peer ID stored in the prefix.
// If there's no such pipe just silently ignore the message.
- zmq_assert (msg_->size () == 4);
- uint32_t peer_id = get_uint32 ((unsigned char*) msg_->data ());
- outpipes_t::iterator it = outpipes.find (peer_id);
-
- if (it != outpipes.end ()) {
- current_out = it->second.pipe;
- msg_t empty;
- int rc = empty.init ();
- errno_assert (rc == 0);
- if (!current_out->check_write (&empty)) {
- it->second.active = false;
- more_out = false;
- current_out = NULL;
+ if (msg_->size () == 4) {
+ uint32_t peer_id = get_uint32 ((unsigned char*) msg_->data ());
+ outpipes_t::iterator it = outpipes.find (peer_id);
+
+ if (it != outpipes.end ()) {
+ current_out = it->second.pipe;
+ msg_t empty;
+ int rc = empty.init ();
+ errno_assert (rc == 0);
+ if (!current_out->check_write (&empty)) {
+ it->second.active = false;
+ more_out = false;
+ current_out = NULL;
+ }
+ rc = empty.close ();
+ errno_assert (rc == 0);
}
- rc = empty.close ();
- errno_assert (rc == 0);
}
}