]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
When refreshing, consider entries being served stale as *really* stale
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Fri, 8 Jul 2022 11:49:34 +0000 (13:49 +0200)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Fri, 9 Sep 2022 07:45:15 +0000 (09:45 +0200)
pdns/recursordist/negcache.cc

index e86e49a18fbdc663995cc9f3e6da7af0e479d5ab..0a1db6ae38d8675ff422e81b7065230f5561f832 100644 (file)
@@ -125,7 +125,7 @@ bool NegCache::get(const DNSName& qname, const QType& qtype, const struct timeva
       if (!refresh && (serveStale || ni->d_servedStale > 0) && ni->d_ttd <= now.tv_sec && ni->d_servedStale < s_maxServedStaleExtensions) {
         updateStaleEntry(now.tv_sec, firstIndexIterator);
       }
-      if (now.tv_sec < ni->d_ttd) {
+      if (now.tv_sec < ni->d_ttd && !(refresh && ni->d_servedStale > 0)) {
         // Not expired
         ne = *ni;
         moveCacheItemToBack<SequenceTag>(content->d_map, firstIndexIterator);