From 1f1cb9cb6150d5174898a95c6c27ae8d631147d9 Mon Sep 17 00:00:00 2001 From: Alan Conway Date: Fri, 26 Sep 2008 19:41:43 +0000 Subject: Bugfix, tests were crashing. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@699466 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/cluster/Connection.cpp | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) (limited to 'cpp') diff --git a/cpp/src/qpid/cluster/Connection.cpp b/cpp/src/qpid/cluster/Connection.cpp index 0db4a01f3f..21eec0f86e 100644 --- a/cpp/src/qpid/cluster/Connection.cpp +++ b/cpp/src/qpid/cluster/Connection.cpp @@ -109,24 +109,25 @@ void Connection::closed() { cluster.catchUpClosed(boost::intrusive_ptr(this)); if (isShadow()) catchUp = false; - else + else { connection.closed(); - } - else { - // Local network connection has closed. We need to keep the - // connection around but replace the output handler with a - // no-op handler as the network output handler will be - // deleted. - output.setOutputHandler(discardHandler); - - if (isLocal()) { - // This was a local replicated connection. Multicast a deliver - // closed and process any outstanding frames from the cluster - // until self-delivery of deliver-close. - cluster.mcastControl(ClusterConnectionDeliverCloseBody(), this); - ++mcastSeq; + return; } } + + // Local network connection has closed. We need to keep the + // connection around but replace the output handler with a + // no-op handler as the network output handler will be + // deleted. + output.setOutputHandler(discardHandler); + + if (isLocal() && !catchUp) { + // This was a local replicated connection. Multicast a deliver + // closed and process any outstanding frames from the cluster + // until self-delivery of deliver-close. + cluster.mcastControl(ClusterConnectionDeliverCloseBody(), this); + ++mcastSeq; + } } catch (const std::exception& e) { QPID_LOG(error, QPID_MSG("While closing connection: " << e.what())); -- cgit v1.2.1