From 8ad76093e682ee735314a6768709b77a09d152ec Mon Sep 17 00:00:00 2001 From: Alan Conway Date: Wed, 5 Nov 2008 17:09:33 +0000 Subject: Cluster: clean up connections when a member leaves the cluster. Fixed a memory error in cluster_test and some reporting errors in test scripts. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@711623 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/cluster/Connection.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'cpp/src/qpid/cluster/Connection.cpp') diff --git a/cpp/src/qpid/cluster/Connection.cpp b/cpp/src/qpid/cluster/Connection.cpp index 513816735d..bcdc4ffe27 100644 --- a/cpp/src/qpid/cluster/Connection.cpp +++ b/cpp/src/qpid/cluster/Connection.cpp @@ -141,6 +141,7 @@ void Connection::delivered(framing::AMQFrame& f) { } } +// A local connection is closed by the network layer. void Connection::closed() { try { if (catchUp) { @@ -165,12 +166,19 @@ void Connection::closed() { } } +// Self-delivery of close message, close the connection. void Connection::deliverClose () { assert(!catchUp); connection.closed(); cluster.erase(self); } +// Member of a shadow connection left the cluster. +void Connection::left() { + assert(isShadow()); + connection.closed(); +} + // Decode data from local clients. size_t Connection::decode(const char* buffer, size_t size) { if (catchUp) { // Handle catch-up locally. -- cgit v1.2.1