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 | 1e6335bf3418e87e07976eccce2d06e90f1a7ad8 (patch) | |
| tree | 5929a469fcb097a4d00fb17fb597ab689cd9976e /qpid/cpp/src | |
| parent | f879373292236ace97e72b3f6b8c80365b212c91 (diff) | |
| download | qpid-python-1e6335bf3418e87e07976eccce2d06e90f1a7ad8.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@1633798 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src')
| -rw-r--r-- | qpid/cpp/src/qpid/broker/amqp/Session.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/qpid/cpp/src/qpid/broker/amqp/Session.cpp b/qpid/cpp/src/qpid/broker/amqp/Session.cpp index f633a4f5d4..041c0b6117 100644 --- a/qpid/cpp/src/qpid/broker/amqp/Session.cpp +++ b/qpid/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)); |
