From: Otto Moerbeek Date: Fri, 6 Jan 2023 13:29:45 +0000 (+0100) Subject: Merge pull request #12374 from omoerbeek/rec-cache-clean X-Git-Tag: dnsdist-1.8.0-rc1~137 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=496a6d0448bb06b983a2bc9934442218f09051f7;p=thirdparty%2Fpdns.git Merge pull request #12374 from omoerbeek/rec-cache-clean Rec: make cache cleaning more fair when under pressure --- 496a6d0448bb06b983a2bc9934442218f09051f7 diff --cc pdns/recursordist/negcache.hh index 4e4264cee4,01a4e402b6..4e4648aa48 --- a/pdns/recursordist/negcache.hh +++ b/pdns/recursordist/negcache.hh @@@ -87,14 -87,14 +87,14 @@@ public }; void add(const NegCacheEntry& ne); - void updateValidationStatus(const DNSName& qname, const QType& qtype, const vState newState, boost::optional capTTD); - bool get(const DNSName& qname, const QType& qtype, const struct timeval& now, NegCacheEntry& ne, bool typeMustMatch = false, bool serverStale = false, bool refresh = false); + void updateValidationStatus(const DNSName& qname, QType qtype, vState newState, boost::optional capTTD); + bool get(const DNSName& qname, QType qtype, const struct timeval& now, NegCacheEntry& ne, bool typeMustMatch = false, bool serverStale = false, bool refresh = false); bool getRootNXTrust(const DNSName& qname, const struct timeval& now, NegCacheEntry& ne, bool serveStale, bool refresh); size_t count(const DNSName& qname); - size_t count(const DNSName& qname, const QType qtype); + size_t count(const DNSName& qname, QType qtype); void prune(size_t maxEntries); void clear(); - size_t dumpToFile(FILE* fd, const struct timeval& now); + size_t doDump(int fd, size_t maxCacheEntries); size_t wipe(const DNSName& name, bool subtree = false); size_t size() const;