diff options
| author | Pavel Moravec <pmoravec@apache.org> | 2014-10-23 12:20:35 +0000 |
|---|---|---|
| committer | Pavel Moravec <pmoravec@apache.org> | 2014-10-23 12:20:35 +0000 |
| commit | 0fb708055d4906436994a0de0ec538a93fc0a609 (patch) | |
| tree | bc37a2a6ceb351d930fb1ffff519cb998c383872 /cpp | |
| parent | a6f82e653f45b6865aff2204eeb95aba0b4d3f59 (diff) | |
| download | qpid-python-0fb708055d4906436994a0de0ec538a93fc0a609.tar.gz | |
QPID-6182: AMQP 1.0 consumer should be able to get messages from browse-only queue
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1633798 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp')
| -rw-r--r-- | cpp/src/qpid/broker/amqp/Session.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/cpp/src/qpid/broker/amqp/Session.cpp b/cpp/src/qpid/broker/amqp/Session.cpp index f633a4f5d4..041c0b6117 100644 --- a/cpp/src/qpid/broker/amqp/Session.cpp +++ b/cpp/src/qpid/broker/amqp/Session.cpp @@ -464,7 +464,7 @@ void Session::setupOutgoing(pn_link_t* link, pn_terminus_t* source, const std::s if (node.queue) { authorise.outgoing(node.queue); - SubscriptionType type = pn_terminus_get_distribution_mode(source) == PN_DIST_MODE_COPY ? BROWSER : CONSUMER; + SubscriptionType type = (pn_terminus_get_distribution_mode(source) == PN_DIST_MODE_COPY) || (node.queue->isBrowseOnly()) ? BROWSER : CONSUMER; if (type == CONSUMER && node.queue->hasExclusiveOwner() && !node.queue->isExclusiveOwner(this)) { throw Exception(qpid::amqp::error_conditions::PRECONDITION_FAILED, std::string("Cannot consume from exclusive queue ") + node.queue->getName()); } @@ -472,6 +472,7 @@ void Session::setupOutgoing(pn_link_t* link, pn_terminus_t* source, const std::s q->init(); filter.apply(q); outgoing[link] = q; + pn_terminus_set_distribution_mode(pn_link_source(link), type == BROWSER ? PN_DIST_MODE_COPY : PN_DIST_MODE_MOVE); } else if (node.exchange) { authorise.access(node.exchange);//do separate access check before trying to create the queue bool shared = is_capability_requested(SHARED, pn_terminus_capabilities(source)); |
