From: Otto Moerbeek Date: Mon, 25 Mar 2024 11:24:28 +0000 (+0100) Subject: Apply suggestions from code review X-Git-Tag: rec-5.1.0-alpha1~82^2~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=cf30269392f38d6585a58765cd4a8e7fe51a928b;p=thirdparty%2Fpdns.git Apply suggestions from code review Co-authored-by: Fred Morcos Co-authored-by: Remi Gacogne --- diff --git a/pdns/recursordist/rec-system-resolve.cc b/pdns/recursordist/rec-system-resolve.cc index 46d3aa17f4..07e60e71b7 100644 --- a/pdns/recursordist/rec-system-resolve.cc +++ b/pdns/recursordist/rec-system-resolve.cc @@ -262,7 +262,7 @@ void pdns::RecResolve::Refresher::refreshLoop() break; } condVar.wait_for(lock, std::chrono::seconds(remaining), - [&wakeup = wakeup] { return wakeup.load(); }); + [&doWakeup = wakeup] { return doWakeup.load(); }); wakeup = false; if (stop) { break; diff --git a/pdns/recursordist/rec-system-resolve.hh b/pdns/recursordist/rec-system-resolve.hh index 3374ea6569..d70d27ed3b 100644 --- a/pdns/recursordist/rec-system-resolve.hh +++ b/pdns/recursordist/rec-system-resolve.hh @@ -33,7 +33,7 @@ #include "lock.hh" /************************************************************************************************ -The pdns::RecResove class implements a facility to use the system configured resolver. At the moment +The pdns::RecResolve class implements a facility to use the system configured resolver. At the moment of writing, this can only be used to configure forwarding by name instead of IP. ************************************************************************************************/ @@ -43,12 +43,12 @@ DESIGN CONSIDERATIONS - all names looked up with lookupAndRegister() will be entered into a table. - the names in the table will ber periodically checked by a refresh thread. Set the period (before - starting to use the system resolver) by calling pdbs::RecResolve::setInstanceParameters(). + starting to use the system resolver) by calling pdns::RecResolve::setInstanceParameters(). -- if *a* name resolves to a different result than stored, we will call the callback. Curently this is +- if *a* name resolves to a different result than stored, we will call the callback. Currently this is used to call the equivalent of rec_control reload-zones -- A manual rec_control reload-zones will *also* flush the existng table before doing the reload, so +- A manual rec_control reload-zones will *also* flush the existing table before doing the reload, so we force a re-resolve all names. See rec_channel_rec.cc:reloadZoneConfigurationWithSysResolveReset() @@ -62,8 +62,8 @@ PRACTICAL CONSIDERATIONS/IMPLEMENTATION LIMITS - We resolve with AI_ADDRCONFIG, the address families enabled will depend on the network config of the machine -- We pick the first adress that getaddrinfo() produced. Currently no handling of multiple addresses - and/or multiple address famailies. +- We pick the first address that getaddrinfo() produced. Currently no handling of multiple addresses + and/or multiple address families. - There is a check to detect *some* cases of self-resolve. This is done by resolving id.server/CH/TXT and comparing the result to the system-id set. Both false positives and false @@ -110,7 +110,7 @@ private: LockGuarded d_data; const time_t d_ttl; - // This private class impements the refresher thread + // This private class implements the refresher thread class Refresher { public: