From 05b0237a8bbdb66bc299b73837d691bbfa412ce7 Mon Sep 17 00:00:00 2001 From: Gordon Sim Date: Wed, 21 Jan 2015 14:50:52 +0000 Subject: QPID-6325: further improve 0-10 connection handling logic git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1653547 13f79535-47bb-0310-9956-ffa450edef68 --- qpid/cpp/src/qpid/broker/ConnectionHandler.cpp | 14 +++++++------- qpid/cpp/src/qpid/broker/ConnectionHandler.h | 3 ++- 2 files changed, 9 insertions(+), 8 deletions(-) (limited to 'qpid/cpp') diff --git a/qpid/cpp/src/qpid/broker/ConnectionHandler.cpp b/qpid/cpp/src/qpid/broker/ConnectionHandler.cpp index eece59d095..8972040be5 100644 --- a/qpid/cpp/src/qpid/broker/ConnectionHandler.cpp +++ b/qpid/cpp/src/qpid/broker/ConnectionHandler.cpp @@ -242,17 +242,17 @@ void ConnectionHandler::Handler::open(const string& /*virtualHost*/, AclModule* acl = connection.getBroker().getAcl(); if (acl && acl->userAclRules()) { if (!acl->authorise(connection.getUserId(),acl::ACT_CREATE,acl::OBJ_LINK,"")){ - proxy.close(framing::connection::CLOSE_CODE_CONNECTION_FORCED, - QPID_MSG("ACL denied " << connection.getUserId() - << " creating a federation link")); + connection.close(framing::connection::CLOSE_CODE_CONNECTION_FORCED, + QPID_MSG("ACL denied " << connection.getUserId() + << " creating a federation link")); return; } } else { if (connection.getBroker().isAuthenticating()) { - proxy.close(framing::connection::CLOSE_CODE_CONNECTION_FORCED, - QPID_MSG("User " << connection.getUserId() - << " federation connection denied. Systems with authentication " - "enabled must specify ACL create link rules.")); + connection.close(framing::connection::CLOSE_CODE_CONNECTION_FORCED, + QPID_MSG("User " << connection.getUserId() + << " federation connection denied. Systems with authentication " + "enabled must specify ACL create link rules.")); return; } } diff --git a/qpid/cpp/src/qpid/broker/ConnectionHandler.h b/qpid/cpp/src/qpid/broker/ConnectionHandler.h index 7af2fe3cb4..30155fb903 100644 --- a/qpid/cpp/src/qpid/broker/ConnectionHandler.h +++ b/qpid/cpp/src/qpid/broker/ConnectionHandler.h @@ -100,13 +100,14 @@ class ConnectionHandler : public framing::FrameHandler std::auto_ptr handler; bool handle(const qpid::framing::AMQMethodBody& method); + void close(framing::connection::CloseCode code, const std::string& text); public: ConnectionHandler(amqp_0_10::Connection& connection, bool isClient ); - void close(framing::connection::CloseCode code, const std::string& text); void heartbeat(); void handle(framing::AMQFrame& frame); void setSecureConnection(SecureConnection* secured); bool isOpen() { return handler->isOpen; } + friend class amqp_0_10::Connection; }; -- cgit v1.2.1