From 1852df5d00eda8d25b7c11a01144fca629fc6427 Mon Sep 17 00:00:00 2001 From: Gordon Sim Date: Tue, 22 Apr 2008 20:14:15 +0000 Subject: Moved federation to final 0-10 codepath git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@650635 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/broker/ConnectionHandler.cpp | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) (limited to 'cpp/src/qpid/broker/ConnectionHandler.cpp') diff --git a/cpp/src/qpid/broker/ConnectionHandler.cpp b/cpp/src/qpid/broker/ConnectionHandler.cpp index c017520334..c7738cc4ea 100644 --- a/cpp/src/qpid/broker/ConnectionHandler.cpp +++ b/cpp/src/qpid/broker/ConnectionHandler.cpp @@ -65,23 +65,24 @@ void ConnectionHandler::handle(framing::AMQFrame& frame) } } -ConnectionHandler::ConnectionHandler(Connection& connection) : handler(new Handler(connection)) {} +ConnectionHandler::ConnectionHandler(Connection& connection, bool isClient) : handler(new Handler(connection, isClient)) {} -ConnectionHandler::Handler::Handler(Connection& c) : +ConnectionHandler::Handler::Handler(Connection& c, bool isClient) : client(c.getOutput()), server(c.getOutput()), - connection(c), serverMode(false) + connection(c), serverMode(!isClient) { - FieldTable properties; - Array mechanisms(0x95); - - authenticator = SaslAuthenticator::createAuthenticator(c); - authenticator->getMechanisms(mechanisms); - - Array locales(0x95); - boost::shared_ptr l(new Str16Value(en_US)); - locales.add(l); - serverMode = true; - client.start(properties, mechanisms, locales); + if (serverMode) { + FieldTable properties; + Array mechanisms(0x95); + + authenticator = SaslAuthenticator::createAuthenticator(c); + authenticator->getMechanisms(mechanisms); + + Array locales(0x95); + boost::shared_ptr l(new Str16Value(en_US)); + locales.add(l); + client.start(properties, mechanisms, locales); + } } -- cgit v1.2.1