diff options
| author | Alan Conway <aconway@apache.org> | 2010-07-23 19:26:07 +0000 |
|---|---|---|
| committer | Alan Conway <aconway@apache.org> | 2010-07-23 19:26:07 +0000 |
| commit | 45bd90654fcf2117938f4b6c17e2ad9b311d2f63 (patch) | |
| tree | f7d9e16ed0dc97a1cf75cf56fa03a41fc31e803b /qpid/cpp/src | |
| parent | b544a9ad06c899a5e5730dfe33d5d01e7782ac70 (diff) | |
| download | qpid-python-45bd90654fcf2117938f4b6c17e2ad9b311d2f63.tar.gz | |
QPID-2702 --max-connections does not work when using cluster.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@967215 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src')
| -rw-r--r-- | qpid/cpp/src/qpid/cluster/ConnectionCodec.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/qpid/cpp/src/qpid/cluster/ConnectionCodec.cpp b/qpid/cpp/src/qpid/cluster/ConnectionCodec.cpp index 91ec10903c..d0ba8abfb3 100644 --- a/qpid/cpp/src/qpid/cluster/ConnectionCodec.cpp +++ b/qpid/cpp/src/qpid/cluster/ConnectionCodec.cpp @@ -36,8 +36,17 @@ namespace cluster { using namespace framing; sys::ConnectionCodec* -ConnectionCodec::Factory::create(ProtocolVersion v, sys::OutputControl& out, const std::string& id, - const qpid::sys::SecuritySettings& external) { +ConnectionCodec::Factory::create(ProtocolVersion v, sys::OutputControl& out, + const std::string& id, + const qpid::sys::SecuritySettings& external) +{ + broker::Broker& broker = cluster.getBroker(); + if (broker.getConnectionCounter().allowConnection()) + { + QPID_LOG(error, "Client max connection count limit exceeded: " + << broker.getOptions().maxConnections << " connection refused"); + return 0; + } if (v == ProtocolVersion(0, 10)) return new ConnectionCodec(v, out, id, cluster, false, false, external); else if (v == ProtocolVersion(0x80 + 0, 0x80 + 10)) // Catch-up connection |
