From 9e82faab313bab906dc1e6e2dda02b4db9dbf993 Mon Sep 17 00:00:00 2001 From: Alan Conway Date: Thu, 27 May 2010 20:02:41 +0000 Subject: Fixed: authentication with bad credentials causes cluster broker to exit. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@948969 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/cluster/Connection.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'cpp/src/qpid') diff --git a/cpp/src/qpid/cluster/Connection.cpp b/cpp/src/qpid/cluster/Connection.cpp index 18d0e0e599..0772215b83 100644 --- a/cpp/src/qpid/cluster/Connection.cpp +++ b/cpp/src/qpid/cluster/Connection.cpp @@ -573,12 +573,22 @@ void Connection::queue(const std::string& encoded) { } void Connection::sessionError(uint16_t , const std::string& msg) { - cluster.flagError(*this, ERROR_TYPE_SESSION, msg); + // If we are negotiating the connection when it fails just close the connectoin. + // If it fails after that then we have to flag the error to the cluster. + if (inConnectionNegotiation) + cluster.getMulticast().mcastControl(ClusterConnectionDeliverCloseBody(), self); + else + cluster.flagError(*this, ERROR_TYPE_SESSION, msg); } void Connection::connectionError(const std::string& msg) { - cluster.flagError(*this, ERROR_TYPE_CONNECTION, msg); + // If we are negotiating the connection when it fails just close the connectoin. + // If it fails after that then we have to flag the error to the cluster. + if (inConnectionNegotiation) + cluster.getMulticast().mcastControl(ClusterConnectionDeliverCloseBody(), self); + else + cluster.flagError(*this, ERROR_TYPE_CONNECTION, msg); } void Connection::addQueueListener(const std::string& q, uint32_t listener) { -- cgit v1.2.1