diff options
| author | Gordon Sim <gsim@apache.org> | 2007-02-14 16:58:52 +0000 |
|---|---|---|
| committer | Gordon Sim <gsim@apache.org> | 2007-02-14 16:58:52 +0000 |
| commit | 9cb1922884c5b258c961046e6fd48e5152aa79d5 (patch) | |
| tree | 04662c38d1b70112619fe316e0b1de1d7de05f1c /cpp/lib/broker | |
| parent | b4b64a31a12cfd7578baab35d5036169825b53c1 (diff) | |
| download | qpid-python-9cb1922884c5b258c961046e6fd48e5152aa79d5.tar.gz | |
Added durability property to queues and pass this to broker on declare. (This change also applied on trunk)
Minor update of accumulated ack and test.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/branches/qpid.0-9@507622 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/lib/broker')
| -rw-r--r-- | cpp/lib/broker/AccumulatedAck.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/cpp/lib/broker/AccumulatedAck.cpp b/cpp/lib/broker/AccumulatedAck.cpp index 5f66adb2b9..34547224ec 100644 --- a/cpp/lib/broker/AccumulatedAck.cpp +++ b/cpp/lib/broker/AccumulatedAck.cpp @@ -27,12 +27,12 @@ using std::bind2nd; using namespace qpid::broker; void AccumulatedAck::update(u_int64_t firstTag, u_int64_t lastTag){ - assert(firstTag<=lastTag); - if (firstTag <= range+1) { - range = lastTag; + assert(firstTag<=lastTag); + if (firstTag <= range + 1) { + if (lastTag > range) range = lastTag; } else { for (u_int64_t tag = firstTag; tag<=lastTag; tag++) - individual.push_back(tag); + individual.push_back(tag); } } @@ -40,6 +40,11 @@ void AccumulatedAck::consolidate(){ individual.sort(); //remove any individual tags that are covered by range individual.remove_if(bind2nd(less_equal<u_int64_t>(), range)); + //update range if possible (using <= allows for duplicates from overlapping ranges) + while (individual.front() <= range + 1) { + range = individual.front(); + individual.pop_front(); + } } void AccumulatedAck::clear(){ |
