From 5b8af52efc0ddf1df5506a2800aa69bc50a44ddb Mon Sep 17 00:00:00 2001 From: Steven McCoy Date: Mon, 11 Oct 2010 17:59:58 +0200 Subject: Fix assertion in PGM transports on cancel_timer Signed-off-by: Steven McCoy --- src/pgm_receiver.cpp | 2 ++ src/pgm_sender.cpp | 12 ++++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/pgm_receiver.cpp b/src/pgm_receiver.cpp index 01b95b2..b0e92f9 100644 --- a/src/pgm_receiver.cpp +++ b/src/pgm_receiver.cpp @@ -235,6 +235,8 @@ void zmq::pgm_receiver_t::timer_event (int token) { zmq_assert (token == rx_timer_id); + // Timer cancels on return by poller_base. + has_rx_timer = false; in_event (); } diff --git a/src/pgm_sender.cpp b/src/pgm_sender.cpp index 82a37ab..3fc0d90 100644 --- a/src/pgm_sender.cpp +++ b/src/pgm_sender.cpp @@ -188,11 +188,15 @@ void zmq::pgm_sender_t::out_event () void zmq::pgm_sender_t::timer_event (int token) { - if (token == rx_timer_id) + // Timer cancels on return by poller_base. + if (token == rx_timer_id) { + has_rx_timer = false; in_event (); - - zmq_assert (token == tx_timer_id); - out_event (); + } else if (token == tx_timer_id) { + has_tx_timer = false; + out_event (); + } else + zmq_assert (false); } #endif -- cgit v1.2.3