summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2008-05-28 13:56:59 +0000
committerGordon Sim <gsim@apache.org>2008-05-28 13:56:59 +0000
commit31b4548068864bcc4d28af57f1a908e1e34ff1ee (patch)
tree63ba5333bbee418ae1015817d4b1f55b41b7954c /cpp/src
parent94d64897d2fd071d89ef668ca953a1d6e15d781a (diff)
downloadqpid-python-31b4548068864bcc4d28af57f1a908e1e34ff1ee.tar.gz
QPID-1098: correction to queue query when queue is not known
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@660953 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/qpid/broker/SessionAdapter.cpp27
1 files changed, 16 insertions, 11 deletions
diff --git a/cpp/src/qpid/broker/SessionAdapter.cpp b/cpp/src/qpid/broker/SessionAdapter.cpp
index 1830b2b94c..9a90c2d970 100644
--- a/cpp/src/qpid/broker/SessionAdapter.cpp
+++ b/cpp/src/qpid/broker/SessionAdapter.cpp
@@ -220,17 +220,22 @@ bool SessionAdapter::QueueHandlerImpl::isLocal(const ConnectionToken* t) const
QueueQueryResult SessionAdapter::QueueHandlerImpl::query(const string& name)
{
- Queue::shared_ptr queue = getQueue(name);
- Exchange::shared_ptr alternateExchange = queue->getAlternateExchange();
-
- return QueueQueryResult(queue->getName(),
- alternateExchange ? alternateExchange->getName() : "",
- queue->isDurable(),
- queue->hasExclusiveOwner(),
- queue->isAutoDelete(),
- queue->getSettings(),
- queue->getMessageCount(),
- queue->getConsumerCount());
+ Queue::shared_ptr queue = session.getBroker().getQueues().find(name);
+ if (queue) {
+
+ Exchange::shared_ptr alternateExchange = queue->getAlternateExchange();
+
+ return QueueQueryResult(queue->getName(),
+ alternateExchange ? alternateExchange->getName() : "",
+ queue->isDurable(),
+ queue->hasExclusiveOwner(),
+ queue->isAutoDelete(),
+ queue->getSettings(),
+ queue->getMessageCount(),
+ queue->getConsumerCount());
+ } else {
+ return QueueQueryResult();
+ }
}
void SessionAdapter::QueueHandlerImpl::declare(const string& name, const string& alternateExchange,