summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/cluster
diff options
context:
space:
mode:
authorMichael Goulish <mgoulish@apache.org>2011-12-16 13:40:58 +0000
committerMichael Goulish <mgoulish@apache.org>2011-12-16 13:40:58 +0000
commitd9ff8e43999e4c59d4092064a6e2c80773534864 (patch)
tree9f798f3b1004e28be4a2352877fc38a0eef94a2c /cpp/src/qpid/cluster
parent2f56ee691a7a824d641820005f0cc7e99ec96d8f (diff)
downloadqpid-python-d9ff8e43999e4c59d4092064a6e2c80773534864.tar.gz
QPID-3438
fix cluster causing cnx leak when bad credentials are given in login attempt. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1215127 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/cluster')
-rw-r--r--cpp/src/qpid/cluster/Cluster.cpp9
-rw-r--r--cpp/src/qpid/cluster/Cluster.h2
-rw-r--r--cpp/src/qpid/cluster/Connection.cpp7
3 files changed, 17 insertions, 1 deletions
diff --git a/cpp/src/qpid/cluster/Cluster.cpp b/cpp/src/qpid/cluster/Cluster.cpp
index 40bfcd9285..3c1d23c842 100644
--- a/cpp/src/qpid/cluster/Cluster.cpp
+++ b/cpp/src/qpid/cluster/Cluster.cpp
@@ -383,12 +383,21 @@ void Cluster::erase(const ConnectionId& id) {
erase(id,l);
}
+void Cluster::eraseLocal(const ConnectionId& id) {
+ Lock l(lock);
+ eraseLocal(id,l);
+}
+
// Called by Connection::deliverClose() in deliverFrameQueue thread.
void Cluster::erase(const ConnectionId& id, Lock&) {
connections.erase(id);
decoder.erase(id);
}
+void Cluster::eraseLocal(const ConnectionId& id, Lock&) {
+ localConnections.getErase(id);
+}
+
std::vector<string> Cluster::getIds() const {
Lock l(lock);
return getIds(l);
diff --git a/cpp/src/qpid/cluster/Cluster.h b/cpp/src/qpid/cluster/Cluster.h
index f517c1b8d0..40f1445f23 100644
--- a/cpp/src/qpid/cluster/Cluster.h
+++ b/cpp/src/qpid/cluster/Cluster.h
@@ -101,6 +101,7 @@ class Cluster : private Cpg::Handler, public management::Manageable {
void addLocalConnection(const ConnectionPtr&);
void addShadowConnection(const ConnectionPtr&);
void erase(const ConnectionId&);
+ void eraseLocal(const ConnectionId&);
// URLs of current cluster members.
std::vector<std::string> getIds() const;
@@ -212,6 +213,7 @@ class Cluster : private Cpg::Handler, public management::Manageable {
void memberUpdate(Lock&);
void setClusterId(const framing::Uuid&, Lock&);
void erase(const ConnectionId&, Lock&);
+ void eraseLocal(const ConnectionId&, Lock&);
void requestUpdate(Lock& );
void initMapCompleted(Lock&);
void becomeElder(Lock&);
diff --git a/cpp/src/qpid/cluster/Connection.cpp b/cpp/src/qpid/cluster/Connection.cpp
index 17fcf6deb5..88a2806877 100644
--- a/cpp/src/qpid/cluster/Connection.cpp
+++ b/cpp/src/qpid/cluster/Connection.cpp
@@ -738,8 +738,13 @@ void Connection::sessionError(uint16_t , const std::string& msg) {
void Connection::connectionError(const std::string& msg) {
// Ignore errors before isOpen(), we're not multicasting yet.
- if (connection->isOpen())
+ if (connection->isOpen()) {
cluster.flagError(*this, ERROR_TYPE_CONNECTION, msg);
+ }
+ else
+ if ( connection->securityFailure() ) {
+ cluster.eraseLocal(self);
+ }
}
void Connection::addQueueListener(const std::string& q, uint32_t listener) {