From fe8e0a127ec7101565bcf3d64f97f96d988dd30f Mon Sep 17 00:00:00 2001 From: Alan Conway Date: Fri, 13 Jan 2012 20:32:33 +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/branches/qpid-3603@1231288 13f79535-47bb-0310-9956-ffa450edef68 --- qpid/cpp/src/qpid/broker/SemanticState.cpp | 12 ++++-------- qpid/cpp/src/qpid/broker/SemanticState.h | 1 - 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/qpid/cpp/src/qpid/broker/SemanticState.cpp b/qpid/cpp/src/qpid/broker/SemanticState.cpp index 5d0024e290..38265c6e8d 100644 --- a/qpid/cpp/src/qpid/broker/SemanticState.cpp +++ b/qpid/cpp/src/qpid/broker/SemanticState.cpp @@ -95,7 +95,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; } @@ -432,8 +432,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); @@ -441,13 +443,7 @@ void SemanticState::unsubscribe(ConsumerImpl::shared_ptr c) Queue::tryAutoDelete(session.getBroker(), queue); } } -} - -void SemanticState::cancel(ConsumerImpl::shared_ptr c) -{ c->cancel(); - disable(c); - unsubscribe(c); } void SemanticState::handle(intrusive_ptr msg) { diff --git a/qpid/cpp/src/qpid/broker/SemanticState.h b/qpid/cpp/src/qpid/broker/SemanticState.h index 09721daaf5..e0bbcbcf12 100644 --- a/qpid/cpp/src/qpid/broker/SemanticState.h +++ b/qpid/cpp/src/qpid/broker/SemanticState.h @@ -190,7 +190,6 @@ class SemanticState : private boost::noncopyable { AckRange findRange(DeliveryId first, DeliveryId last); void requestDispatch(); void cancel(ConsumerImpl::shared_ptr); - void unsubscribe(ConsumerImpl::shared_ptr); void disable(ConsumerImpl::shared_ptr); public: -- cgit v1.2.1