diff options
author | Alan Conway <aconway@apache.org> | 2012-01-13 20:32:33 +0000 |
---|---|---|
committer | Alan Conway <aconway@apache.org> | 2012-01-13 20:32:33 +0000 |
commit | fe8e0a127ec7101565bcf3d64f97f96d988dd30f (patch) | |
tree | 326ee0522bee8724ee85e80cd63676909f4f0349 | |
parent | 9bb88e1261bb3bf2893d4745c67568bb9732c4f8 (diff) | |
download | qpid-python-fe8e0a127ec7101565bcf3d64f97f96d988dd30f.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/branches/qpid-3603@1231288 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | qpid/cpp/src/qpid/broker/SemanticState.cpp | 12 | ||||
-rw-r--r-- | 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<Message> 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: |