Commit be23e699 authored by Joe Eli McIlvain's avatar Joe Eli McIlvain

Merge pull request #1314 from topher200/master

Close messages that failed to send
parents 94b0ad3e 866a0465
...@@ -246,12 +246,16 @@ int zmq::router_t::xsend (msg_t *msg_) ...@@ -246,12 +246,16 @@ int zmq::router_t::xsend (msg_t *msg_)
} }
bool ok = current_out->write (msg_); bool ok = current_out->write (msg_);
if (unlikely (!ok)) if (unlikely (!ok)) {
current_out = NULL; // Message failed to send - we must close it ourselves.
else int rc = msg_->close ();
if (!more_out) { errno_assert (rc == 0);
current_out->flush ();
current_out = NULL; current_out = NULL;
} else {
if (!more_out) {
current_out->flush ();
current_out = NULL;
}
} }
} }
else { else {
......
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