diff options
author | Charles E. Rolke <chug@apache.org> | 2012-09-07 20:24:43 +0000 |
---|---|---|
committer | Charles E. Rolke <chug@apache.org> | 2012-09-07 20:24:43 +0000 |
commit | 4ea8b46602b10fcaf817378daa7254f959d633cf (patch) | |
tree | 3d7ff5da997148ec1fbecc37d7048cbb5f3bbd1a /cpp/src | |
parent | 1e49b9a6e59c9a767cbd573a54656fba2e4329dd (diff) | |
download | qpid-python-4ea8b46602b10fcaf817378daa7254f959d633cf.tar.gz |
QPID-4142 C++ Broker connection counting. Revert r1371772 which applied only to 0.18 and is obsolete on trunk.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1382155 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/qpid/acl/Acl.cpp | 7 | ||||
-rw-r--r-- | cpp/src/qpid/acl/Acl.h | 1 | ||||
-rw-r--r-- | cpp/src/qpid/acl/AclConnectionCounter.cpp | 41 | ||||
-rw-r--r-- | cpp/src/qpid/acl/AclConnectionCounter.h | 1 | ||||
-rw-r--r-- | cpp/src/qpid/broker/AclModule.h | 4 | ||||
-rw-r--r-- | cpp/src/qpid/broker/Connection.cpp | 8 |
6 files changed, 0 insertions, 62 deletions
diff --git a/cpp/src/qpid/acl/Acl.cpp b/cpp/src/qpid/acl/Acl.cpp index 6eeda9f26c..cd79add720 100644 --- a/cpp/src/qpid/acl/Acl.cpp +++ b/cpp/src/qpid/acl/Acl.cpp @@ -141,13 +141,6 @@ bool Acl::approveConnection(const qpid::broker::Connection& conn) return connectionCounter->approveConnection(conn); } - -void Acl::setUserId(const qpid::broker::Connection& connection, const std::string& username) -{ - connectionCounter->setUserId(connection, username); -} - - bool Acl::approveCreateQueue(const std::string& userId, const std::string& queueName) { return resourceCounter->approveCreateQueue(userId, queueName); diff --git a/cpp/src/qpid/acl/Acl.h b/cpp/src/qpid/acl/Acl.h index e0513d5d1e..a23952ff53 100644 --- a/cpp/src/qpid/acl/Acl.h +++ b/cpp/src/qpid/acl/Acl.h @@ -98,7 +98,6 @@ public: // Resource quota tracking virtual bool approveConnection(const broker::Connection& connection); - virtual void setUserId(const broker::Connection& connection, const std::string& username); virtual bool approveCreateQueue(const std::string& userId, const std::string& queueName); virtual void recordDestroyQueue(const std::string& queueName); diff --git a/cpp/src/qpid/acl/AclConnectionCounter.cpp b/cpp/src/qpid/acl/AclConnectionCounter.cpp index 8c6e3eef6e..052fa3c222 100644 --- a/cpp/src/qpid/acl/AclConnectionCounter.cpp +++ b/cpp/src/qpid/acl/AclConnectionCounter.cpp @@ -296,47 +296,6 @@ bool ConnectionCounter::approveConnection(const broker::Connection& connection) } } - -// -// setUserId -// On cluster shadow connections, track a new user id for this connection. -// -void ConnectionCounter::setUserId(const broker::Connection& connection, - const std::string& username) -{ - Mutex::ScopedLock locker(dataLock); - - connectCountsMap_t::iterator eRef = connectProgressMap.find(connection.getMgmtId()); - if (eRef != connectProgressMap.end()) { - if ((*eRef).second == C_OPENED){ - // Connection has been opened so that current user has been counted - if (connection.isShadow()) { - // This is a shadow connection and therefore receives userId changes - QPID_LOG(debug, "Changing User ID for cluster connection: " - << connection.getMgmtId() << ", old user:'" << connection.getUserId() - << "', new user:'" << username << "'"); - - // Decrement user in-use count for old userId - releaseLH(connectByNameMap, - connection.getUserId(), - nameLimit); - // Increment user in-use count for new userId - (void) countConnectionLH(connectByNameMap, username, nameLimit, false); - } else { - QPID_LOG(warning, "Changing User ID for non-cluster connections is not supported: " - << connection.getMgmtId() << ", old user " << connection.getUserId() - << ", new user " << username); - } - } else { - // connection exists but has not been opened. - // setUserId is called in normal course. The user gets counted when connection is opened. - } - } else { - // Connection does not exist. - } -} - - // // getClientIp - given a connection's mgmtId return the client host part. // diff --git a/cpp/src/qpid/acl/AclConnectionCounter.h b/cpp/src/qpid/acl/AclConnectionCounter.h index 54fa6933ff..eec8e90256 100644 --- a/cpp/src/qpid/acl/AclConnectionCounter.h +++ b/cpp/src/qpid/acl/AclConnectionCounter.h @@ -94,7 +94,6 @@ public: // Connection counting bool approveConnection(const broker::Connection& conn); - void setUserId(const broker::Connection& connection, const std::string& username); }; }} // namespace qpid::ha diff --git a/cpp/src/qpid/broker/AclModule.h b/cpp/src/qpid/broker/AclModule.h index 4070e49559..d8b80fc39c 100644 --- a/cpp/src/qpid/broker/AclModule.h +++ b/cpp/src/qpid/broker/AclModule.h @@ -153,10 +153,6 @@ namespace broker { */ virtual bool approveConnection (const Connection& connection)=0; - /** Change connection's counted userId - */ - virtual void setUserId(const Connection& connection, const std::string& username)=0; - /** Approve queue creation by counting per-user. */ virtual bool approveCreateQueue(const std::string& userId, const std::string& queueName)=0; diff --git a/cpp/src/qpid/broker/Connection.cpp b/cpp/src/qpid/broker/Connection.cpp index e68c906cc2..8d250a32e5 100644 --- a/cpp/src/qpid/broker/Connection.cpp +++ b/cpp/src/qpid/broker/Connection.cpp @@ -25,7 +25,6 @@ #include "qpid/broker/Bridge.h" #include "qpid/broker/Broker.h" #include "qpid/broker/Queue.h" -#include "qpid/broker/AclModule.h" #include "qpid/sys/SecuritySettings.h" #include "qpid/sys/ClusterSafe.h" @@ -279,13 +278,6 @@ void Connection::notifyConnectionForced(const string& text) void Connection::setUserId(const string& userId) { - // Account for changing userId - AclModule* acl = broker.getAcl(); - if (acl) - { - acl->setUserId(*this, userId); - } - ConnectionState::setUserId(userId); // In a cluster, the cluster code will raise the connect event // when the connection is replicated to the cluster. |