0
0
mirror of https://github.com/zeromq/libzmq.git synced 2024-12-27 15:41:05 +08:00

Problem: Handshake timeout error with ZMTP_2_0

When two parties are trying to establish ZMTP connection and do a
handshake, in which one partie selects hanshake version 2 or lower
has been selected, handshake timer fires always (by default after 30s)
as the timer never gets cancelled.

Solution: Cancel handshake timer after handhake has been done.
This commit is contained in:
Đorđije Manojlović 2022-10-28 15:44:04 +02:00
parent 8d4f4efef0
commit 6cc694d8c2

View File

@ -255,8 +255,14 @@ bool zmq::stream_engine_base_t::in_event_internal ()
// Switch into the normal message flow. // Switch into the normal message flow.
_handshaking = false; _handshaking = false;
if (_mechanism == NULL && _has_handshake_stage) if (_mechanism == NULL && _has_handshake_stage) {
_session->engine_ready (); _session->engine_ready ();
if (_has_handshake_timer) {
cancel_timer (handshake_timer_id);
_has_handshake_timer = false;
}
}
} else } else
return false; return false;
} }