From: Remi Gacogne Date: Tue, 20 Jun 2017 15:09:56 +0000 (+0200) Subject: Remove just enough entries from the cache, not one more than asked X-Git-Tag: rec-4.0.6~2^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F5480%2Fhead;p=thirdparty%2Fpdns.git Remove just enough entries from the cache, not one more than asked (cherry picked from commit f3cb7c78abe3ad639d4583880ae9302b3be99a9e) --- diff --git a/pdns/cachecleaner.hh b/pdns/cachecleaner.hh index fdeeb2c190..2566e19d6c 100644 --- a/pdns/cachecleaner.hh +++ b/pdns/cachecleaner.hh @@ -60,7 +60,7 @@ template void pruneCollection(T& collection, unsigned int maxCached else ++iter; - if(toTrim && erased > toTrim) + if(toTrim && erased >= toTrim) break; }