summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/broker/SemanticState.cpp
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2007-10-04 12:01:28 +0000
committerGordon Sim <gsim@apache.org>2007-10-04 12:01:28 +0000
commit44c50b719e5685bd7a25cdeb9c5c9202ed8dc29a (patch)
tree0227574c78bff90a747c573393616b17ecddfccf /cpp/src/qpid/broker/SemanticState.cpp
parent3263908aff26ae784d0399b03d869bfc1b035ebd (diff)
downloadqpid-python-44c50b719e5685bd7a25cdeb9c5c9202ed8dc29a.tar.gz
Fix (and refactor) processing of ranges in message handler.
Alter release() to push released messages onto head in reverse order (todo: make this atomic instead) git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@581869 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/broker/SemanticState.cpp')
-rw-r--r--cpp/src/qpid/broker/SemanticState.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/cpp/src/qpid/broker/SemanticState.cpp b/cpp/src/qpid/broker/SemanticState.cpp
index 11bce282eb..e435ed0522 100644
--- a/cpp/src/qpid/broker/SemanticState.cpp
+++ b/cpp/src/qpid/broker/SemanticState.cpp
@@ -572,7 +572,11 @@ void SemanticState::release(DeliveryId first, DeliveryId last)
{
Mutex::ScopedLock locker(deliveryLock);
AckRange range = findRange(first, last);
- for_each(range.start, range.end, mem_fun_ref(&DeliveryRecord::release));
+ //release results in the message being added to the head so want
+ //to release in reverse order to keep the original transfer order
+ DeliveryRecords::reverse_iterator start(range.end);
+ DeliveryRecords::reverse_iterator end(range.start);
+ for_each(start, end, mem_fun_ref(&DeliveryRecord::release));
}
void SemanticState::reject(DeliveryId first, DeliveryId last)