summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/broker/SemanticState.cpp
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2012-01-18 22:08:53 +0000
committerAlan Conway <aconway@apache.org>2012-01-18 22:08:53 +0000
commit5efd6b9fbae26020beeca030920baedfbc84e71b (patch)
treeb99072f68420f3d9191e6702d4e7d84c4219a2b3 /cpp/src/qpid/broker/SemanticState.cpp
parent3fc9d63cfed81df8e2a0b62e246aaa2d82e7ea42 (diff)
downloadqpid-python-5efd6b9fbae26020beeca030920baedfbc84e71b.tar.gz
QPID-3603: Merge SemanticState unsubscribe with cancel.
Simplyfig the code, there is no need for these to be separate functions. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1233087 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/broker/SemanticState.cpp')
-rw-r--r--cpp/src/qpid/broker/SemanticState.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/cpp/src/qpid/broker/SemanticState.cpp b/cpp/src/qpid/broker/SemanticState.cpp
index 0956501e76..2b9fd247f5 100644
--- a/cpp/src/qpid/broker/SemanticState.cpp
+++ b/cpp/src/qpid/broker/SemanticState.cpp
@@ -93,7 +93,7 @@ void SemanticState::closed() {
//now unsubscribe, which may trigger queue deletion and thus
//needs to occur after the requeueing of unacked messages
for (ConsumerImplMap::iterator i = consumers.begin(); i != consumers.end(); i++) {
- unsubscribe(i->second);
+ cancel(i->second);
}
closeComplete = true;
}
@@ -408,8 +408,10 @@ void SemanticState::disable(ConsumerImpl::shared_ptr c)
session.getConnection().outputTasks.removeOutputTask(c.get());
}
-void SemanticState::unsubscribe(ConsumerImpl::shared_ptr c)
+
+void SemanticState::cancel(ConsumerImpl::shared_ptr c)
{
+ disable(c);
Queue::shared_ptr queue = c->getQueue();
if(queue) {
queue->cancel(c);
@@ -417,12 +419,7 @@ void SemanticState::unsubscribe(ConsumerImpl::shared_ptr c)
Queue::tryAutoDelete(session.getBroker(), queue);
}
}
-}
-
-void SemanticState::cancel(ConsumerImpl::shared_ptr c)
-{
- disable(c);
- unsubscribe(c);
+ c->cancel();
}
void SemanticState::handle(intrusive_ptr<Message> msg) {