diff options
author | Gordon Sim <gsim@apache.org> | 2009-02-12 11:43:51 +0000 |
---|---|---|
committer | Gordon Sim <gsim@apache.org> | 2009-02-12 11:43:51 +0000 |
commit | 3f7745fb58b028058a860d7e95f308404728f09f (patch) | |
tree | dd28c178bed1a4f38dbb05e755cee7448e87600c /cpp/src/qpid/broker/SemanticState.cpp | |
parent | 30072b3b418ab9b0af293482878591b7beb6e9bf (diff) | |
download | qpid-python-3f7745fb58b028058a860d7e95f308404728f09f.tar.gz |
QPID-1660: If selected consumer can't take a message, ensure others are notified of message availability.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@743694 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/broker/SemanticState.cpp')
-rw-r--r-- | cpp/src/qpid/broker/SemanticState.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/cpp/src/qpid/broker/SemanticState.cpp b/cpp/src/qpid/broker/SemanticState.cpp index 13a8c649d2..4f751e43b7 100644 --- a/cpp/src/qpid/broker/SemanticState.cpp +++ b/cpp/src/qpid/broker/SemanticState.cpp @@ -527,9 +527,19 @@ void SemanticState::ConsumerImpl::addMessageCredit(uint32_t value) } } +bool SemanticState::ConsumerImpl::haveCredit() +{ + if (msgCredit) { + return true; + } else { + blocked = true; + return false; + } +} + void SemanticState::ConsumerImpl::flush() { - while(queue->dispatch(shared_from_this())) + while(haveCredit() && queue->dispatch(shared_from_this())) ; stop(); } @@ -587,7 +597,7 @@ bool SemanticState::ConsumerImpl::hasOutput() { bool SemanticState::ConsumerImpl::doOutput() { - return queue->dispatch(shared_from_this()); + return haveCredit() && queue->dispatch(shared_from_this()); } void SemanticState::ConsumerImpl::enableNotify() |