From: Otto Moerbeek Date: Fri, 11 Mar 2022 14:24:22 +0000 (+0100) Subject: Distinguish between unreachable and timeout for throttling X-Git-Tag: rec-4.7.0-beta1~57^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9dcb9bdff431c5de7906ffc46533c6830a792b8c;p=thirdparty%2Fpdns.git Distinguish between unreachable and timeout for throttling Git history shows this was converted wrongly when hardcoded values were replaced by enum values --- diff --git a/pdns/syncres.cc b/pdns/syncres.cc index 87704cb417..87e9c1ea01 100644 --- a/pdns/syncres.cc +++ b/pdns/syncres.cc @@ -4245,7 +4245,7 @@ bool SyncRes::doResolveAtThisIP(const std::string& prefix, const DNSName& qname, spoofed = true; } else { - /* -1 means server unreachable */ + /* LWResult::Result::PermanentError */ s_unreachables++; d_unreachables++; // XXX questionable use of errno @@ -4263,7 +4263,7 @@ bool SyncRes::doResolveAtThisIP(const std::string& prefix, const DNSName& qname, // mark server as down t_sstorage.throttle.throttle(d_now.tv_sec, std::make_tuple(remoteIP, g_rootdnsname, 0), s_serverdownthrottletime, 10000); } - else if (resolveret == LWResult::Result::Timeout) { + else if (resolveret == LWResult::Result::PermanentError) { // unreachable, 1 minute or 100 queries t_sstorage.throttle.throttle(d_now.tv_sec, std::make_tuple(remoteIP, qname, qtype.getCode()), 60, 100); }