mirror of
https://github.com/zeromq/libzmq.git
synced 2025-10-27 02:53:12 +01:00
Problem with ZMQ_ROUTER_MANDATORY option when peer lost
indention Revert "indention" This reverts commit a6e7e192ac2d089ac9f7dc0d31d4b1fd10de982e. indention indention Fix Failure in tests Check both pipe full and pipe close
This commit is contained in:
@@ -212,15 +212,30 @@ int zmq::router_t::xsend (msg_t *msg_)
|
||||
|
||||
if (it != outpipes.end ()) {
|
||||
current_out = it->second.pipe;
|
||||
if (!current_out->check_write ()) {
|
||||
|
||||
// Check whether pipe is full or not
|
||||
if (!current_out->check_hwm()) {
|
||||
it->second.active = false;
|
||||
current_out = NULL;
|
||||
|
||||
if (mandatory) {
|
||||
more_out = false;
|
||||
errno = EAGAIN;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
// Check whether pipe is closed or not
|
||||
else
|
||||
if (!current_out->check_write()) {
|
||||
it->second.active = false;
|
||||
current_out = NULL;
|
||||
|
||||
if (mandatory) {
|
||||
more_out = false;
|
||||
errno = EHOSTUNREACH;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
if (mandatory) {
|
||||
|
||||
Reference in New Issue
Block a user