From e90a09d3778a69769189e96d9ddbea2677b83910 Mon Sep 17 00:00:00 2001 From: Otto Moerbeek Date: Fri, 29 Nov 2019 14:36:12 +0100 Subject: [PATCH] Correct when to replace a throttle entry --- pdns/syncres.hh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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; }); } -- 2.47.2