summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/broker/BrokerChannel.cpp
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2007-07-03 14:54:19 +0000
committerGordon Sim <gsim@apache.org>2007-07-03 14:54:19 +0000
commit338f2196c07ea6ce2cd40941bca9ef11e95be2bf (patch)
tree63ac3fe82c7d668850608ea19334997960089062 /cpp/src/qpid/broker/BrokerChannel.cpp
parente7f82f3d5b39c77ee913ee4cd6b4bf1bdc8b13bc (diff)
downloadqpid-python-338f2196c07ea6ce2cd40941bca9ef11e95be2bf.tar.gz
Fix (and test) for QPID-407. Messages are requeued at the head rather than the tail.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@552862 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/broker/BrokerChannel.cpp')
-rw-r--r--cpp/src/qpid/broker/BrokerChannel.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/cpp/src/qpid/broker/BrokerChannel.cpp b/cpp/src/qpid/broker/BrokerChannel.cpp
index f6a50a7ef5..86768f0d88 100644
--- a/cpp/src/qpid/broker/BrokerChannel.cpp
+++ b/cpp/src/qpid/broker/BrokerChannel.cpp
@@ -330,9 +330,9 @@ void Channel::ack(uint64_t firstTag, uint64_t lastTag){
Mutex::ScopedLock locker(deliveryLock);//need to synchronize with possible concurrent delivery
ack_iterator i = find_if(unacked.begin(), unacked.end(), bind2nd(mem_fun_ref(&DeliveryRecord::matches), lastTag));
- ack_iterator j = (firstTag == 0) ?
- unacked.begin() :
- find_if(unacked.begin(), unacked.end(), bind2nd(mem_fun_ref(&DeliveryRecord::matches), firstTag));
+ ack_iterator j = (firstTag == 0) ?
+ unacked.begin() :
+ find_if(unacked.begin(), unacked.end(), bind2nd(mem_fun_ref(&DeliveryRecord::matches), firstTag));
if(i == unacked.end()){
throw ConnectionException(530, "Received ack for unrecognised delivery tag");
@@ -364,7 +364,7 @@ void Channel::recover(bool requeue){
outstanding.reset();
std::list<DeliveryRecord> copy = unacked;
unacked.clear();
- for_each(copy.begin(), copy.end(), mem_fun_ref(&DeliveryRecord::requeue));
+ for_each(copy.rbegin(), copy.rend(), mem_fun_ref(&DeliveryRecord::requeue));
}else{
for_each(unacked.begin(), unacked.end(), bind2nd(mem_fun_ref(&DeliveryRecord::redeliver), this));
}