Skip to content

Commit

Permalink
Problem: Handshake timeout error with ZMTP_2_0
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Đorđije Manojlović committed Nov 11, 2022
1 parent 8d4f4ef commit 6cc694d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/stream_engine_base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,14 @@ bool zmq::stream_engine_base_t::in_event_internal ()
// Switch into the normal message flow.
_handshaking = false;

if (_mechanism == NULL && _has_handshake_stage)
if (_mechanism == NULL && _has_handshake_stage) {
_session->engine_ready ();

if (_has_handshake_timer) {
cancel_timer (handshake_timer_id);
_has_handshake_timer = false;
}
}
} else
return false;
}
Expand Down

0 comments on commit 6cc694d

Please sign in to comment.