Update router.cpp

This commit is contained in:
ZhuXxxx 2024-03-11 18:23:30 +08:00 committed by GitHub
parent 5db878ebad
commit 93827b020a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -185,12 +185,13 @@ int zmq::router_t::xsend (msg_t *msg_)
if (!_current_out->check_write ()) {
// Check whether pipe is full or not
const bool pipe_full = !_current_out->check_hwm ();
const bool pipe_active = _current_out->is_active();
out_pipe->active = false;
_current_out = NULL;
if (_mandatory) {
_more_out = false;
if (pipe_full)
if (pipe_full && pipe_active)
errno = EAGAIN;
else
errno = EHOSTUNREACH;