Commit ec2ba8a9 authored by Luca Boccassi's avatar Luca Boccassi Committed by GitHub

Merge pull request #2283 from vtellier/master

Fixed issue #2227 second part
parents ee98e7dc ea7e03a7
...@@ -421,8 +421,7 @@ void zmq::session_base_t::engine_error ( ...@@ -421,8 +421,7 @@ void zmq::session_base_t::engine_error (
if (pipe) if (pipe)
clean_pipes (); clean_pipes ();
zmq_assert (reason == stream_engine_t::encryption_error zmq_assert (reason == stream_engine_t::connection_error
|| reason == stream_engine_t::connection_error
|| reason == stream_engine_t::timeout_error || reason == stream_engine_t::timeout_error
|| reason == stream_engine_t::protocol_error); || reason == stream_engine_t::protocol_error);
...@@ -434,7 +433,6 @@ void zmq::session_base_t::engine_error ( ...@@ -434,7 +433,6 @@ void zmq::session_base_t::engine_error (
else else
terminate (); terminate ();
break; break;
case stream_engine_t::encryption_error:
case stream_engine_t::protocol_error: case stream_engine_t::protocol_error:
terminate (); terminate ();
break; break;
......
...@@ -356,10 +356,7 @@ void zmq::stream_engine_t::in_event () ...@@ -356,10 +356,7 @@ void zmq::stream_engine_t::in_event ()
// or the session has rejected the message. // or the session has rejected the message.
if (rc == -1) { if (rc == -1) {
if (errno != EAGAIN) { if (errno != EAGAIN) {
if(this->process_msg == &stream_engine_t::process_handshake_command) error(protocol_error);
error(encryption_error);
else
error(protocol_error);
return; return;
} }
input_stopped = true; input_stopped = true;
...@@ -981,7 +978,7 @@ void zmq::stream_engine_t::error (error_reason_t reason) ...@@ -981,7 +978,7 @@ void zmq::stream_engine_t::error (error_reason_t reason)
} }
zmq_assert (session); zmq_assert (session);
#ifdef ZMQ_BUILD_DRAFT_API #ifdef ZMQ_BUILD_DRAFT_API
if(reason == encryption_error) if(mechanism == NULL || mechanism->status() == mechanism_t::handshaking)
socket->event_handshake_failed(endpoint, (int) s); socket->event_handshake_failed(endpoint, (int) s);
#endif #endif
socket->event_disconnected (endpoint, (int) s); socket->event_disconnected (endpoint, (int) s);
......
...@@ -65,8 +65,7 @@ namespace zmq ...@@ -65,8 +65,7 @@ namespace zmq
enum error_reason_t { enum error_reason_t {
protocol_error, protocol_error,
connection_error, connection_error,
timeout_error, timeout_error
encryption_error
}; };
stream_engine_t (fd_t fd_, const options_t &options_, stream_engine_t (fd_t fd_, const options_t &options_,
......
...@@ -19,6 +19,8 @@ to add a sleep, please be consistent with all the other tests and use: ...@@ -19,6 +19,8 @@ to add a sleep, please be consistent with all the other tests and use:
# Building tests in Windows # Building tests in Windows
According to the version of your compiler, you should adapt the path `libzmq.lib` in the file `tests/CMakeLists.txt`.
Install CMAKE Install CMAKE
CMD> CMAKE libzmq/tests CMD> CMAKE libzmq/tests
CMD> tests.sln CMD> tests.sln
......
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