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.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/cpp/src/qpid/broker/ConnectionHandler.cpp b/cpp/src/qpid/broker/ConnectionHandler.cpp
index 270711705e..948aa04417 100644
--- a/cpp/src/qpid/broker/ConnectionHandler.cpp
+++ b/cpp/src/qpid/broker/ConnectionHandler.cpp
@@ -68,8 +68,15 @@ void ConnectionHandler::handle(framing::AMQFrame& frame)
AMQMethodBody* method=frame.getBody()->getMethod();
Connection::ErrorListener* errorListener = handler->connection.getErrorListener();
try{
- if (!invoke(static_cast<AMQP_AllOperations::ConnectionHandler&>(*handler.get()), *method)) {
+ if (method && invoke(
+ static_cast<AMQP_AllOperations::ConnectionHandler&>(*handler), *method)) {
+ // This is a connection control frame, nothing more to do.
+ } else if (isOpen()) {
handler->connection.getChannel(frame.getChannel()).in(frame);
+ } else {
+ handler->proxy.close(
+ connection::CLOSE_CODE_FRAMING_ERROR,
+ "Connection not yet open, invalid frame received.");
}
}catch(ConnectionException& e){
if (errorListener) errorListener->connectionError(e.what());