mirror of
https://github.com/zeromq/libzmq.git
synced 2025-01-15 02:07:59 +08:00
close (clean up) unsendable messages
This commit is contained in:
parent
583a5f9601
commit
89dd9fddaf
@ -246,12 +246,16 @@ int zmq::router_t::xsend (msg_t *msg_)
|
||||
}
|
||||
|
||||
bool ok = current_out->write (msg_);
|
||||
if (unlikely (!ok))
|
||||
current_out = NULL;
|
||||
else
|
||||
if (!more_out) {
|
||||
current_out->flush ();
|
||||
if (unlikely (!ok)) {
|
||||
// Message failed to send - we must close it ourselves.
|
||||
int rc = msg_->close ();
|
||||
errno_assert (rc == 0);
|
||||
current_out = NULL;
|
||||
} else {
|
||||
if (!more_out) {
|
||||
current_out->flush ();
|
||||
current_out = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user