Problem: inconsistent handling of ZAP replies

Solution: unification, pulled up common behaviour to zap_client_t/zap_client_common_handshake_t
This commit is contained in:
sigiesec
2017-08-16 17:12:49 +02:00
parent 8c58ef7f5c
commit 8dce0396fb
7 changed files with 39 additions and 43 deletions

View File

@@ -79,7 +79,7 @@ int zmq::null_mechanism_t::next_handshake_command (msg_t *msg_)
return -1;
zap_request_sent = true;
rc = receive_and_process_zap_reply ();
if (rc != 0)
if (rc == -1 || rc == 1)
return -1;
zap_reply_received = true;
}
@@ -170,7 +170,7 @@ int zmq::null_mechanism_t::zap_msg_available ()
const int rc = receive_and_process_zap_reply ();
if (rc == 0)
zap_reply_received = true;
return rc;
return rc == -1 ? -1 : 0;
}
zmq::mechanism_t::status_t zmq::null_mechanism_t::status () const