Merge branch 'master' of github.com:CopernicaMarketingSoftware/AMQP-CPP

This commit is contained in:
Emiel Bruijntjes 2020-10-23 08:14:35 +02:00
commit eaf0d5e9b5
1 changed files with 11 additions and 11 deletions

View File

@ -76,12 +76,12 @@ private:
// do multiple at once // do multiple at once
else else
{ {
// find the last element, inclusive
auto upper = _handlers.upper_bound(deliveryTag);
// call the handlers // call the handlers
for (auto iter = _handlers.begin(); iter != upper; iter++) for (auto iter = _handlers.begin(); iter != _handlers.end(); iter++)
{ {
// make sure this is the right deliverytag, if we've passed it we leap out
if (iter->first > deliveryTag) break;
// call the handler // call the handler
iter->second->reportAck(); iter->second->reportAck();
@ -90,7 +90,7 @@ private:
} }
// erase all acknowledged items // erase all acknowledged items
_handlers.erase(_handlers.begin(), upper); _handlers.erase(_handlers.begin(), _handlers.upper_bound(deliveryTag));
} }
// make sure the object is still valid // make sure the object is still valid
@ -134,12 +134,12 @@ private:
// nack multiple elements // nack multiple elements
else else
{ {
// find the last element, inclusive
auto upper = _handlers.upper_bound(deliveryTag);
// call the handlers // call the handlers
for (auto iter = _handlers.begin(); iter != upper; iter++) for (auto iter = _handlers.begin(); iter != _handlers.end(); iter++)
{ {
// make sure this is the right deliverytag, if we've passed it we leap out
if (iter->first > deliveryTag) break;
// call the handler // call the handler
iter->second->reportNack(); iter->second->reportNack();
@ -147,8 +147,8 @@ private:
if (!monitor) return; if (!monitor) return;
} }
// erase all acknowledged items // erase all negatively acknowledged items
_handlers.erase(_handlers.begin(), upper); _handlers.erase(_handlers.begin(), _handlers.upper_bound(deliveryTag));
} }
// if the object is no longer valid, return // if the object is no longer valid, return