mirror of
https://github.com/zeromq/libzmq.git
synced 2025-10-26 10:32:58 +01:00
add session->zap_enabled()
checks mechanism != NULL, or NULL + non-empty zap_domain
This commit is contained in:
@@ -534,7 +534,7 @@ bool zmq::stream_engine_t::handshake ()
|
||||
// Is the peer using ZMTP/1.0 with no revision number?
|
||||
// If so, we send and receive rest of identity message
|
||||
if (greeting_recv [0] != 0xff || !(greeting_recv [9] & 0x01)) {
|
||||
if (session->zap_connect () == 0) {
|
||||
if (session->zap_enabled ()) {
|
||||
// reject ZMTP 1.0 connections if ZAP is enabled
|
||||
error (protocol_error);
|
||||
return false;
|
||||
@@ -581,7 +581,7 @@ bool zmq::stream_engine_t::handshake ()
|
||||
}
|
||||
else
|
||||
if (greeting_recv [revision_pos] == ZMTP_1_0) {
|
||||
if (session->zap_connect () == 0) {
|
||||
if (session->zap_enabled ()) {
|
||||
// reject ZMTP 1.0 connections if ZAP is enabled
|
||||
error (protocol_error);
|
||||
return false;
|
||||
@@ -597,7 +597,7 @@ bool zmq::stream_engine_t::handshake ()
|
||||
}
|
||||
else
|
||||
if (greeting_recv [revision_pos] == ZMTP_2_0) {
|
||||
if (session->zap_connect () == 0) {
|
||||
if (session->zap_enabled ()) {
|
||||
// reject ZMTP 2.0 connections if ZAP is enabled
|
||||
error (protocol_error);
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user