summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/broker/SecureConnectionFactory.cpp
diff options
context:
space:
mode:
authorCarl C. Trieloff <cctrieloff@apache.org>2009-11-17 21:08:10 +0000
committerCarl C. Trieloff <cctrieloff@apache.org>2009-11-17 21:08:10 +0000
commit520f9d2bd95379fbbcc83e8812bfaa531387f937 (patch)
tree3592f0ac60ac67dcedfea3f54881096cb92490ba /cpp/src/qpid/broker/SecureConnectionFactory.cpp
parent86562de96c2d63ca37e8c5435d29ae877fe34929 (diff)
downloadqpid-python-520f9d2bd95379fbbcc83e8812bfaa531387f937.tar.gz
QPID-2188 , support for maxConnections, limit is set to broker
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@881517 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/broker/SecureConnectionFactory.cpp')
-rw-r--r--cpp/src/qpid/broker/SecureConnectionFactory.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/cpp/src/qpid/broker/SecureConnectionFactory.cpp b/cpp/src/qpid/broker/SecureConnectionFactory.cpp
index 4926851f95..9d92d26ac8 100644
--- a/cpp/src/qpid/broker/SecureConnectionFactory.cpp
+++ b/cpp/src/qpid/broker/SecureConnectionFactory.cpp
@@ -23,6 +23,7 @@
#include "qpid/amqp_0_10/Connection.h"
#include "qpid/broker/Connection.h"
#include "qpid/broker/SecureConnection.h"
+#include "qpid/log/Statement.h"
namespace qpid {
namespace broker {
@@ -38,6 +39,11 @@ SecureConnectionFactory::SecureConnectionFactory(Broker& b) : broker(b) {}
sys::ConnectionCodec*
SecureConnectionFactory::create(ProtocolVersion v, sys::OutputControl& out, const std::string& id,
unsigned int conn_ssf ) {
+ if (broker.getConnectionCounter().allowConnection())
+ {
+ QPID_LOG(error, "Client max connection count limit exceeded: " << broker.getOptions().maxConnections << " connection refushed");
+ return 0;
+ }
if (v == ProtocolVersion(0, 10)) {
SecureConnectionPtr sc(new SecureConnection());
CodecPtr c(new amqp_0_10::Connection(out, id, false));