diff options
author | Alan Conway <aconway@apache.org> | 2010-06-08 15:31:31 +0000 |
---|---|---|
committer | Alan Conway <aconway@apache.org> | 2010-06-08 15:31:31 +0000 |
commit | 4f6804221443259a89ff761f798d8c25b9cbffa7 (patch) | |
tree | 4cf4730d2d6f9aab4267ee94d1e5dd897642ebbe /qpid/cpp/src/qpid/broker/ConnectionHandler.cpp | |
parent | 7b3b89d9a5ebf239cc227070b01f911d1b522fbb (diff) | |
download | qpid-python-4f6804221443259a89ff761f798d8c25b9cbffa7.tar.gz |
Cluster handle connection-negotiation phase in local broker.
The connection negotiation phase up to the "open" or "open-ok" frame
establishes whether/what encryption to use for the rest of the
connection.
With this patch a cluster broker completes the initial negotiation
with its local clients and only then begins multicasting to other
brokers. The local broker decrypts if necessary and multicasts in the
clear.
This replaces a problematic locking scheme that was formerly in place
which caused deadlocks.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@952692 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src/qpid/broker/ConnectionHandler.cpp')
-rw-r--r-- | qpid/cpp/src/qpid/broker/ConnectionHandler.cpp | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/qpid/cpp/src/qpid/broker/ConnectionHandler.cpp b/qpid/cpp/src/qpid/broker/ConnectionHandler.cpp index 225735deb6..c349bc7ac7 100644 --- a/qpid/cpp/src/qpid/broker/ConnectionHandler.cpp +++ b/qpid/cpp/src/qpid/broker/ConnectionHandler.cpp @@ -87,7 +87,8 @@ ConnectionHandler::ConnectionHandler(Connection& connection, bool isClient, bool ConnectionHandler::Handler::Handler(Connection& c, bool isClient, bool isShadow) : proxy(c.getOutput()), - connection(c), serverMode(!isClient), acl(0), secured(0), userIdCallback(0) + connection(c), serverMode(!isClient), acl(0), secured(0), + isOpen(false) { if (serverMode) { @@ -195,14 +196,7 @@ void ConnectionHandler::Handler::open(const string& /*virtualHost*/, if (sl.get()) secured->activateSecurityLayer(sl); } - if ( userIdCallback ) { - string s; - // Not checking the return value of getUsername, if there is - // no username then we want to call the userIdCallback anyway - // with an empty string. - authenticator->getUsername(s); - userIdCallback(s); - } + isOpen = true; proxy.openOk(array); } @@ -272,6 +266,7 @@ void ConnectionHandler::Handler::openOk(const framing::Array& knownHosts) Url url((*i)->get<std::string>()); connection.getKnownHosts().push_back(url); } + isOpen = true; } void ConnectionHandler::Handler::redirect(const string& /*host*/, const framing::Array& /*knownHosts*/) |