From df6517b6513aa8278e5feb1b1759da39f50dfc55 Mon Sep 17 00:00:00 2001 From: Alan Conway Date: Tue, 14 Apr 2009 14:19:12 +0000 Subject: Fix regression: close shadow connections belonging to brokers that have left the cluster. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@764783 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/cluster/Cluster.cpp | 4 ++-- cpp/src/qpid/cluster/Connection.h | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'cpp/src/qpid') diff --git a/cpp/src/qpid/cluster/Cluster.cpp b/cpp/src/qpid/cluster/Cluster.cpp index ca325dde36..ff72c6032e 100644 --- a/cpp/src/qpid/cluster/Cluster.cpp +++ b/cpp/src/qpid/cluster/Cluster.cpp @@ -611,13 +611,13 @@ void Cluster::memberUpdate(Lock& l) { mgmtObject->set_memberIDs(idstr); } - // Erase connections belonging to members that have left the cluster. + // Close connections belonging to members that have left the cluster. ConnectionMap::iterator i = connections.begin(); while (i != connections.end()) { ConnectionMap::iterator j = i++; MemberId m = j->second->getId().getMember(); if (m != self && !map.isMember(m)) - connections.erase(j); + j->second->deliverClose(); } } diff --git a/cpp/src/qpid/cluster/Connection.h b/cpp/src/qpid/cluster/Connection.h index 49839a456b..414e5c935f 100644 --- a/cpp/src/qpid/cluster/Connection.h +++ b/cpp/src/qpid/cluster/Connection.h @@ -151,6 +151,8 @@ class Connection : void giveReadCredit(int credit); + void deliverClose(); + private: struct NullFrameHandler : public framing::FrameHandler { void handle(framing::AMQFrame&) {} @@ -165,7 +167,6 @@ class Connection : void init(); bool checkUnsupported(const framing::AMQBody& body); - void deliverClose(); void deliverDoOutput(uint32_t requested); void sendDoOutput(); -- cgit v1.2.1