summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/broker/SemanticHandler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/qpid/broker/SemanticHandler.cpp')
-rw-r--r--cpp/src/qpid/broker/SemanticHandler.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/cpp/src/qpid/broker/SemanticHandler.cpp b/cpp/src/qpid/broker/SemanticHandler.cpp
index 69dd1fd67e..d6e13e0a55 100644
--- a/cpp/src/qpid/broker/SemanticHandler.cpp
+++ b/cpp/src/qpid/broker/SemanticHandler.cpp
@@ -29,6 +29,7 @@
#include "qpid/framing/ExecutionCompleteBody.h"
#include "qpid/framing/ExecutionResultBody.h"
#include "qpid/framing/ServerInvoker.h"
+#include "qpid/log/Statement.h"
#include <boost/format.hpp>
#include <boost/bind.hpp>
@@ -166,10 +167,13 @@ void SemanticHandler::handleContent(AMQFrame& frame)
DeliveryId SemanticHandler::deliver(QueuedMessage& msg, DeliveryToken::shared_ptr token)
{
Mutex::ScopedLock l(outLock);
- MessageDelivery::deliver(
- msg, session.getHandler().out,
- ++outgoing.hwm, token,
- session.getConnection().getFrameMax());
+ SessionHandler* handler = session.getHandler();
+ if (handler) {
+ uint32_t maxFrameSize = handler->getConnection().getFrameMax();
+ MessageDelivery::deliver(msg, handler->out, ++outgoing.hwm, token, maxFrameSize);
+ } else {
+ QPID_LOG(error, "Dropping message as session is no longer attached to a channel.");
+ }
return outgoing.hwm;
}