From 2bbc8a70819ad4075a950b34fc65bc10a3c28951 Mon Sep 17 00:00:00 2001 From: "Charles E. Rolke" Date: Mon, 22 Jul 2013 21:34:14 +0000 Subject: QPID-5011: C++ Broker ACL allows one connection when user quota is zero Compute limit-check result even for first connection. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1505823 13f79535-47bb-0310-9956-ffa450edef68 --- qpid/cpp/src/qpid/acl/AclConnectionCounter.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'qpid/cpp') diff --git a/qpid/cpp/src/qpid/acl/AclConnectionCounter.cpp b/qpid/cpp/src/qpid/acl/AclConnectionCounter.cpp index 3d703066b4..7a5d0ab53d 100644 --- a/qpid/cpp/src/qpid/acl/AclConnectionCounter.cpp +++ b/qpid/cpp/src/qpid/acl/AclConnectionCounter.cpp @@ -102,10 +102,12 @@ bool ConnectionCounter::countConnectionLH( if (eRef != theMap.end()) { count = (uint16_t)(*eRef).second + 1; (*eRef).second = count; - result = (enforceLimit ? count <= theLimit : true); } else { theMap[theName] = count = 1; } + if (enforceLimit) { + result = count <= theLimit; + } if (emitLog) { QPID_LOG(trace, "ACL ConnectionApprover user=" << theName << " limit=" << theLimit -- cgit v1.2.1