Commit ffb31dca authored by Vincent Tellier's avatar Vincent Tellier

Fixed issue #2227 second part

 - removed the previously added encryption_error, less changes less bug
 - handshake fail is now signaled when an error happen while the
   mechanism is still hanshaking
parent ee98e7dc
......@@ -421,8 +421,7 @@ void zmq::session_base_t::engine_error (
if (pipe)
clean_pipes ();
zmq_assert (reason == stream_engine_t::encryption_error
|| reason == stream_engine_t::connection_error
zmq_assert (reason == stream_engine_t::connection_error
|| reason == stream_engine_t::timeout_error
|| reason == stream_engine_t::protocol_error);
......@@ -434,7 +433,6 @@ void zmq::session_base_t::engine_error (
else
terminate ();
break;
case stream_engine_t::encryption_error:
case stream_engine_t::protocol_error:
terminate ();
break;
......
......@@ -356,10 +356,7 @@ void zmq::stream_engine_t::in_event ()
// or the session has rejected the message.
if (rc == -1) {
if (errno != EAGAIN) {
if(this->process_msg == &stream_engine_t::process_handshake_command)
error(encryption_error);
else
error(protocol_error);
error(protocol_error);
return;
}
input_stopped = true;
......@@ -981,7 +978,7 @@ void zmq::stream_engine_t::error (error_reason_t reason)
}
zmq_assert (session);
#ifdef ZMQ_BUILD_DRAFT_API
if(reason == encryption_error)
if(mechanism->status() == mechanism_t::handshaking)
socket->event_handshake_failed(endpoint, (int) s);
#endif
socket->event_disconnected (endpoint, (int) s);
......
......@@ -65,8 +65,7 @@ namespace zmq
enum error_reason_t {
protocol_error,
connection_error,
timeout_error,
encryption_error
timeout_error
};
stream_engine_t (fd_t fd_, const options_t &options_,
......
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