mirror of
https://github.com/zeromq/libzmq.git
synced 2025-11-05 12:47:49 +01:00
Problem: no tests for client-side events for successful handshake and authentication failure in handshake
Solution: added tests for CURVE, add emitting of client-side event in curve_client_t; add ZAP code 300/500 tests for all mechanisms; suppress sending an error message for ZAP code 300
This commit is contained in:
@@ -86,9 +86,8 @@ int zmq::plain_client_t::process_handshake_command (msg_t *msg_)
|
||||
if (data_size >= 6 && !memcmp (cmd_data, "\5ERROR", 6))
|
||||
rc = process_error (cmd_data, data_size);
|
||||
else {
|
||||
// TODO see comment in curve_server_t::process_handshake_command
|
||||
session->get_socket ()->event_handshake_failed_protocol (
|
||||
session->get_endpoint (), ZMQ_PROTOCOL_ERROR_ZMTP_UNSPECIFIED);
|
||||
session->get_endpoint (), ZMQ_PROTOCOL_ERROR_ZMTP_UNEXPECTED_COMMAND);
|
||||
errno = EPROTO;
|
||||
rc = -1;
|
||||
}
|
||||
@@ -215,6 +214,8 @@ int zmq::plain_client_t::process_error (
|
||||
errno = EPROTO;
|
||||
return -1;
|
||||
}
|
||||
const char *error_reason = reinterpret_cast<const char *> (cmd_data) + 7;
|
||||
handle_error_reason (error_reason, error_reason_len);
|
||||
state = error_command_received;
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user