summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/cluster
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2010-05-27 20:02:41 +0000
committerAlan Conway <aconway@apache.org>2010-05-27 20:02:41 +0000
commit9e82faab313bab906dc1e6e2dda02b4db9dbf993 (patch)
tree94a61638d14d20588414b3fe1386518d07c76f46 /cpp/src/qpid/cluster
parentb0ed6faecb9d7dbbe91ac39af6bbdc2ad412253c (diff)
downloadqpid-python-9e82faab313bab906dc1e6e2dda02b4db9dbf993.tar.gz
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
Diffstat (limited to 'cpp/src/qpid/cluster')
-rw-r--r--cpp/src/qpid/cluster/Connection.cpp14
1 files changed, 12 insertions, 2 deletions
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) {