mirror of
https://github.com/zeromq/libzmq.git
synced 2025-05-02 07:31:39 +02:00
Only start the heartbeat timer when the underlying mechanism is ready to stop cipher streams from trying to encrypt a heartbeat before the handshake has completed. Addresses issue #1601.
This commit is contained in:
parent
f6018e81d8
commit
ba3cf3c006
@ -712,11 +712,6 @@ bool zmq::stream_engine_t::handshake ()
|
|||||||
}
|
}
|
||||||
next_msg = &stream_engine_t::next_handshake_command;
|
next_msg = &stream_engine_t::next_handshake_command;
|
||||||
process_msg = &stream_engine_t::process_handshake_command;
|
process_msg = &stream_engine_t::process_handshake_command;
|
||||||
|
|
||||||
if(options.heartbeat_interval > 0) {
|
|
||||||
add_timer(options.heartbeat_interval, heartbeat_ivl_timer_id);
|
|
||||||
has_heartbeat_timer = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Start polling for output if necessary.
|
// Start polling for output if necessary.
|
||||||
@ -824,6 +819,11 @@ void zmq::stream_engine_t::zap_msg_available ()
|
|||||||
|
|
||||||
void zmq::stream_engine_t::mechanism_ready ()
|
void zmq::stream_engine_t::mechanism_ready ()
|
||||||
{
|
{
|
||||||
|
if (options.heartbeat_interval > 0) {
|
||||||
|
add_timer(options.heartbeat_interval, heartbeat_ivl_timer_id);
|
||||||
|
has_heartbeat_timer = true;
|
||||||
|
}
|
||||||
|
|
||||||
if (options.recv_identity) {
|
if (options.recv_identity) {
|
||||||
msg_t identity;
|
msg_t identity;
|
||||||
mechanism->peer_identity (&identity);
|
mechanism->peer_identity (&identity);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user