Commit 9fb9fea6 authored by Martin Sustrik's avatar Martin Sustrik

Improve error reporting in a minor way

Signed-off-by: 's avatarMartin Sustrik <sustrik@250bpm.com>
parent 8b7ac4c2
...@@ -59,7 +59,7 @@ zmq::tcp_connecter_t::tcp_connecter_t (class io_thread_t *io_thread_, ...@@ -59,7 +59,7 @@ zmq::tcp_connecter_t::tcp_connecter_t (class io_thread_t *io_thread_,
// TODO: set_addess should be called separately, so that the error // TODO: set_addess should be called separately, so that the error
// can be propagated. // can be propagated.
int rc = set_address (address_); int rc = set_address (address_);
zmq_assert (rc == 0); errno_assert (rc == 0);
} }
zmq::tcp_connecter_t::~tcp_connecter_t () zmq::tcp_connecter_t::~tcp_connecter_t ()
......
...@@ -130,22 +130,23 @@ int zmq::xrep_t::xsend (msg_t *msg_, int flags_) ...@@ -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. // Find the pipe associated with the peer ID stored in the prefix.
// If there's no such pipe just silently ignore the message. // If there's no such pipe just silently ignore the message.
zmq_assert (msg_->size () == 4); if (msg_->size () == 4) {
uint32_t peer_id = get_uint32 ((unsigned char*) msg_->data ()); uint32_t peer_id = get_uint32 ((unsigned char*) msg_->data ());
outpipes_t::iterator it = outpipes.find (peer_id); outpipes_t::iterator it = outpipes.find (peer_id);
if (it != outpipes.end ()) { if (it != outpipes.end ()) {
current_out = it->second.pipe; current_out = it->second.pipe;
msg_t empty; msg_t empty;
int rc = empty.init (); int rc = empty.init ();
errno_assert (rc == 0); errno_assert (rc == 0);
if (!current_out->check_write (&empty)) { if (!current_out->check_write (&empty)) {
it->second.active = false; it->second.active = false;
more_out = false; more_out = false;
current_out = NULL; current_out = NULL;
}
rc = empty.close ();
errno_assert (rc == 0);
} }
rc = empty.close ();
errno_assert (rc == 0);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment