summaryrefslogtreecommitdiff
path: root/qpid/cpp/src/qpid/broker/SemanticState.cpp
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2011-02-25 17:30:59 +0000
committerGordon Sim <gsim@apache.org>2011-02-25 17:30:59 +0000
commite1060b0eaccaf2e8f90db93318ed5bfeb59d9be8 (patch)
treeb88e3bfb5f2585a26be3f7a2b8af0f048213001d /qpid/cpp/src/qpid/broker/SemanticState.cpp
parentff841dac2d711d55b1e5edeffbe7471a8d04fb95 (diff)
downloadqpid-python-e1060b0eaccaf2e8f90db93318ed5bfeb59d9be8.tar.gz
QPID-2324: Raise 404 on cancellation if no such subscription exists.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1074642 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src/qpid/broker/SemanticState.cpp')
-rw-r--r--qpid/cpp/src/qpid/broker/SemanticState.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/qpid/cpp/src/qpid/broker/SemanticState.cpp b/qpid/cpp/src/qpid/broker/SemanticState.cpp
index cfc379f47c..a1f206e25d 100644
--- a/qpid/cpp/src/qpid/broker/SemanticState.cpp
+++ b/qpid/cpp/src/qpid/broker/SemanticState.cpp
@@ -116,7 +116,8 @@ void SemanticState::consume(const string& tag,
consumers[tag] = c;
}
-void SemanticState::cancel(const string& tag){
+bool SemanticState::cancel(const string& tag)
+{
ConsumerImplMap::iterator i = consumers.find(tag);
if (i != consumers.end()) {
cancel(i->second);
@@ -124,7 +125,9 @@ void SemanticState::cancel(const string& tag){
//should cancel all unacked messages for this consumer so that
//they are not redelivered on recovery
for_each(unacked.begin(), unacked.end(), boost::bind(&DeliveryRecord::cancel, _1, tag));
-
+ return true;
+ } else {
+ return false;
}
}