summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/broker/ConnectionHandler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/qpid/broker/ConnectionHandler.cpp')
-rw-r--r--cpp/src/qpid/broker/ConnectionHandler.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/cpp/src/qpid/broker/ConnectionHandler.cpp b/cpp/src/qpid/broker/ConnectionHandler.cpp
index 162664fb88..77a4d1a3de 100644
--- a/cpp/src/qpid/broker/ConnectionHandler.cpp
+++ b/cpp/src/qpid/broker/ConnectionHandler.cpp
@@ -26,6 +26,7 @@
#include "Connection.h"
#include "qpid/framing/ClientInvoker.h"
#include "qpid/framing/ServerInvoker.h"
+#include "qpid/framing/constants.h"
#include "qpid/log/Statement.h"
using namespace qpid;
@@ -123,6 +124,10 @@ void ConnectionHandler::Handler::close(uint16_t replyCode, const string& replyTe
if (replyCode != 200) {
QPID_LOG(warning, "Client closed connection with " << replyCode << ": " << replyText);
}
+
+ if (replyCode == framing::connection::CONNECTION_FORCED)
+ connection.notifyConnectionForced(replyText);
+
client.closeOk();
connection.getOutput().close();
}
@@ -136,9 +141,10 @@ void ConnectionHandler::Handler::start(const FieldTable& /*serverProperties*/,
const framing::Array& /*mechanisms*/,
const framing::Array& /*locales*/)
{
- string response;
- server.startOk(FieldTable(), ANONYMOUS, response, en_US);
- connection.initMgmt(true);
+ string mechanism = connection.getAuthMechanism();
+ string response = connection.getAuthCredentials();
+
+ server.startOk(FieldTable(), mechanism, response, en_US);
}
void ConnectionHandler::Handler::secure(const string& /*challenge*/)