Problem: assert used for ZAP error handling aborts process.

This commit is contained in:
evoskuil
2017-03-29 10:43:56 -07:00
parent a6d03df37d
commit f44300cb00
9 changed files with 100 additions and 55 deletions

View File

@@ -183,14 +183,11 @@ int zmq::session_base_t::read_zap_msg (msg_t *msg_)
int zmq::session_base_t::write_zap_msg (msg_t *msg_)
{
if (zap_pipe == NULL) {
if (zap_pipe == NULL || !zap_pipe->write (msg_)) {
errno = ENOTCONN;
return -1;
}
const bool ok = zap_pipe->write (msg_);
zmq_assert (ok);
if ((msg_->flags () & msg_t::more) == 0)
zap_pipe->flush ();