]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Correct when to replace a throttle entry 8571/head
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Fri, 29 Nov 2019 13:36:12 +0000 (14:36 +0100)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Fri, 29 Nov 2019 13:36:12 +0000 (14:36 +0100)
pdns/syncres.hh

index 336a252643edf9b506a631118b6f0bac5cf047c8..2e0c399b494e8921faee52d464b392301ce3ef18 100644 (file)
@@ -113,7 +113,9 @@ public:
     if (i == d_cont.end()) {
       entry_t e = { t, ttd, count };
       d_cont.insert(e);
-    } else if (i->ttd > ttd || i->count < count) { // ????
+    } else if (ttd > i->ttd || count > i->count) {
+      ttd = std::max(i->ttd, ttd);
+      count = std::max(i->count, count);
       auto &ind = d_cont.template get<Thing>();
       ind.modify(i, [ttd,count](entry_t &e) { e.ttd = ttd; e.count = count; });
     }