From: Otto Moerbeek Date: Fri, 29 Nov 2019 13:36:12 +0000 (+0100) Subject: Correct when to replace a throttle entry X-Git-Tag: rec-4.3.0-beta1~1^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F8571%2Fhead;p=thirdparty%2Fpdns.git Correct when to replace a throttle entry --- diff --git a/pdns/syncres.hh b/pdns/syncres.hh index 336a252643..2e0c399b49 100644 --- a/pdns/syncres.hh +++ b/pdns/syncres.hh @@ -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(); ind.modify(i, [ttd,count](entry_t &e) { e.ttd = ttd; e.count = count; }); }