From: Remi Gacogne Date: Thu, 8 Nov 2018 13:30:19 +0000 (+0100) Subject: dnsdist: Fix warnings, mostly unused parameters, reported by -Wextra X-Git-Tag: auth-4.2.0-alpha1~54^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F7168%2Fhead;p=thirdparty%2Fpdns.git dnsdist: Fix warnings, mostly unused parameters, reported by -Wextra --- diff --git a/pdns/dnsdist-web.cc b/pdns/dnsdist-web.cc index cabd48aeb7..8cd977384f 100644 --- a/pdns/dnsdist-web.cc +++ b/pdns/dnsdist-web.cc @@ -68,7 +68,7 @@ static bool apiWriteConfigFile(const string& filebasename, const string& content static void apiSaveACL(const NetmaskGroup& nmg) { vector vec; - g_ACL.getLocal()->toStringVector(&vec); + nmg.toStringVector(&vec); string acl; for(const auto& s : vec) { diff --git a/pdns/dnsdist.cc b/pdns/dnsdist.cc index 115b0f707e..06512bc240 100644 --- a/pdns/dnsdist.cc +++ b/pdns/dnsdist.cc @@ -565,22 +565,22 @@ try { vinfolog("Got an error in UDP responder thread while parsing a response from %s, id %d: %s", dss->remote.toStringWithPort(), queryId, e.what()); } } - return 0; + return nullptr; } catch(const std::exception& e) { errlog("UDP responder thread died because of exception: %s", e.what()); - return 0; + return nullptr; } catch(const PDNSException& e) { errlog("UDP responder thread died because of PowerDNS exception: %s", e.reason); - return 0; + return nullptr; } catch(...) { errlog("UDP responder thread died because of an exception: %s", "unknown"); - return 0; + return nullptr; } bool DownstreamState::reconnect() @@ -1888,7 +1888,7 @@ void* maintThread() // ponder pruning g_dynblocks of expired entries here } - return 0; + return nullptr; } static void* secPollThread() @@ -1994,7 +1994,7 @@ static void* healthChecksThread() } } } - return 0; + return nullptr; } static void bindAny(int af, int sock) diff --git a/pdns/dnsdist.hh b/pdns/dnsdist.hh index 096ff8d8e5..34523acc38 100644 --- a/pdns/dnsdist.hh +++ b/pdns/dnsdist.hh @@ -410,7 +410,7 @@ public: { } - BasicQPSLimiter(unsigned int rate, unsigned int burst): d_tokens(burst) + BasicQPSLimiter(unsigned int burst): d_tokens(burst) { d_prev.start(); } @@ -451,7 +451,7 @@ public: { } - QPSLimiter(unsigned int rate, unsigned int burst): BasicQPSLimiter(rate, burst), d_rate(rate), d_burst(burst), d_passthrough(false) + QPSLimiter(unsigned int rate, unsigned int burst): BasicQPSLimiter(burst), d_rate(rate), d_burst(burst), d_passthrough(false) { d_prev.start(); } diff --git a/pdns/dnsdistdist/tcpiohandler.cc b/pdns/dnsdistdist/tcpiohandler.cc index 4293aa70aa..e91cf6bd23 100644 --- a/pdns/dnsdistdist/tcpiohandler.cc +++ b/pdns/dnsdistdist/tcpiohandler.cc @@ -506,7 +506,7 @@ public: d_ticketKeys.addKey(newKey); if (d_ticketsKeyRotationDelay > 0) { - d_ticketsKeyNextRotation = time(nullptr) + d_ticketsKeyRotationDelay; + d_ticketsKeyNextRotation = now + d_ticketsKeyRotationDelay; } } @@ -840,7 +840,7 @@ public: auto newKey = std::make_shared(); d_ticketsKey = newKey; if (d_ticketsKeyRotationDelay > 0) { - d_ticketsKeyNextRotation = time(nullptr) + d_ticketsKeyRotationDelay; + d_ticketsKeyNextRotation = now + d_ticketsKeyRotationDelay; } }