From 5efd6b9fbae26020beeca030920baedfbc84e71b Mon Sep 17 00:00:00 2001 From: Alan Conway Date: Wed, 18 Jan 2012 22:08:53 +0000 Subject: 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 --- cpp/src/qpid/broker/SemanticState.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'cpp/src/qpid/broker/SemanticState.cpp') 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 msg) { -- cgit v1.2.1