0
0
mirror of https://github.com/zeromq/libzmq.git synced 2024-12-27 15:41:05 +08:00

Improve error reporting in a minor way

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
This commit is contained in:
Martin Sustrik 2011-09-03 07:40:49 +02:00
parent 8b7ac4c2a9
commit 9fb9fea633
2 changed files with 16 additions and 15 deletions

View File

@ -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
// can be propagated.
int rc = set_address (address_);
zmq_assert (rc == 0);
errno_assert (rc == 0);
}
zmq::tcp_connecter_t::~tcp_connecter_t ()

View File

@ -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 (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 (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);
}
}