diff options
| author | Gordon Sim <gsim@apache.org> | 2011-02-21 17:30:17 +0000 |
|---|---|---|
| committer | Gordon Sim <gsim@apache.org> | 2011-02-21 17:30:17 +0000 |
| commit | bfe783485de47f5ee0c321dbe3fb8484a657bbbb (patch) | |
| tree | a119d355ca1d863079a5dc1783023de11fdd9cfa /cpp/src/qpid/broker/SemanticState.cpp | |
| parent | d5e03f22eb498c7dd39dff3d04d9ae05ae673acc (diff) | |
| download | qpid-python-bfe783485de47f5ee0c321dbe3fb8484a657bbbb.tar.gz | |
QPID-3051: Ensure credit window is moved correctly even if it contains rejected messages.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1073085 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/broker/SemanticState.cpp')
| -rw-r--r-- | cpp/src/qpid/broker/SemanticState.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/cpp/src/qpid/broker/SemanticState.cpp b/cpp/src/qpid/broker/SemanticState.cpp index c91cfba2f8..cfc379f47c 100644 --- a/cpp/src/qpid/broker/SemanticState.cpp +++ b/cpp/src/qpid/broker/SemanticState.cpp @@ -697,8 +697,11 @@ void SemanticState::reject(DeliveryId first, DeliveryId last) { AckRange range = findRange(first, last); for_each(range.start, range.end, mem_fun_ref(&DeliveryRecord::reject)); - //need to remove the delivery records as well - unacked.erase(range.start, range.end); + //may need to remove the delivery records as well + for (DeliveryRecords::iterator i = range.start; i != unacked.end() && i->getId() <= last; ) { + if (i->isRedundant()) i = unacked.erase(i); + else i++; + } } bool SemanticState::ConsumerImpl::doOutput() |
