From 23157ecf4b305b25f4355e02d0c5f547666d9837 Mon Sep 17 00:00:00 2001 From: Andrew Stitcher Date: Tue, 23 Jun 2009 20:02:24 +0000 Subject: Once we're aborting the connection due to traffic timeout make sure we cancel heartbeats git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@787811 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/broker/Connection.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'cpp/src') diff --git a/cpp/src/qpid/broker/Connection.cpp b/cpp/src/qpid/broker/Connection.cpp index fb087181a3..c4e8c4335c 100644 --- a/cpp/src/qpid/broker/Connection.cpp +++ b/cpp/src/qpid/broker/Connection.cpp @@ -52,7 +52,7 @@ struct ConnectionTimeoutTask : public TimerTask { Timer& timer; Connection& connection; AbsTime expires; - + ConnectionTimeoutTask(uint16_t hb, Timer& t, Connection& c) : TimerTask(Duration(hb*2*TIME_SEC)), timer(t), @@ -359,6 +359,11 @@ struct ConnectionHeartbeatTask : public TimerTask { void Connection::abort() { + // Make sure that we don't try to send a heartbeat as we're + // aborting the connection + if (heartbeatTimer) + heartbeatTimer->cancel(); + out.abort(); } -- cgit v1.2.1