From cba1dfa2cb3315d9b0aae2900172fafa2e3961da Mon Sep 17 00:00:00 2001 From: Gordon Sim Date: Tue, 26 Feb 2008 08:40:13 +0000 Subject: Use sessions reference to broker rather than connections in semantic state as the sessions ref is valid even when not attached. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@631128 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/broker/SemanticState.cpp | 6 +++--- cpp/src/qpid/broker/SessionContext.h | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'cpp/src') diff --git a/cpp/src/qpid/broker/SemanticState.cpp b/cpp/src/qpid/broker/SemanticState.cpp index c6c0ae5440..9b44f31e14 100644 --- a/cpp/src/qpid/broker/SemanticState.cpp +++ b/cpp/src/qpid/broker/SemanticState.cpp @@ -326,7 +326,7 @@ void SemanticState::cancel(ConsumerImpl& c) if(queue) { queue->cancel(c); if (queue->canAutoDelete() && !queue->hasExclusiveOwner()) { - Queue::tryAutoDelete(getSession().getConnection().getBroker(), queue); + Queue::tryAutoDelete(session.getBroker(), queue); } } } @@ -347,7 +347,7 @@ void SemanticState::route(intrusive_ptr msg, Deliverable& strategy) { std::string exchangeName = msg->getExchangeName(); msg->getProperties()->setExchange(exchangeName); if (!cacheExchange || cacheExchange->getName() != exchangeName){ - cacheExchange = session.getConnection().broker.getExchanges().get(exchangeName); + cacheExchange = session.getBroker().getExchanges().get(exchangeName); } cacheExchange->route(strategy, msg->getRoutingKey(), msg->getApplicationHeaders()); @@ -579,7 +579,7 @@ Queue::shared_ptr SemanticState::getQueue(const string& name) const { if (name.empty()) { throw NotAllowedException(QPID_MSG("No queue name specified.")); } else { - queue = session.getConnection().getBroker().getQueues().find(name); + queue = session.getBroker().getQueues().find(name); if (!queue) throw NotFoundException(QPID_MSG("Queue not found: "<