Commit 7e36db07 authored by Vincent Tellier's avatar Vincent Tellier

Handshake events null pointer fix

The mechanism is instanciated during the handshake itself, when and
error happen before this, the error method shall work anyway.
An error handling with a NULL mechanism means the handshake fail, so the
handshake failure event is also raised in this case.
parent ffb31dca
......@@ -978,7 +978,7 @@ void zmq::stream_engine_t::error (error_reason_t reason)
}
zmq_assert (session);
#ifdef ZMQ_BUILD_DRAFT_API
if(mechanism->status() == mechanism_t::handshaking)
if(mechanism == NULL || mechanism->status() == mechanism_t::handshaking)
socket->event_handshake_failed(endpoint, (int) s);
#endif
socket->event_disconnected (endpoint, (int) s);
......
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