From: Otto Moerbeek Date: Wed, 10 May 2023 07:44:52 +0000 (+0200) Subject: Reformat X-Git-Tag: rec-4.10.0-alpha0~12^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b4de5386c87846da0c523cf229071f94ceb92a54;p=thirdparty%2Fpdns.git Reformat --- diff --git a/pdns/recursordist/taskqueue.cc b/pdns/recursordist/taskqueue.cc index d18a8cb8c9..7e268e4edf 100644 --- a/pdns/recursordist/taskqueue.cc +++ b/pdns/recursordist/taskqueue.cc @@ -52,7 +52,9 @@ bool ResolveTask::run(bool logErrors) const log->error(Logr::Debug, "null task"); return false; } - struct timeval now{}; + struct timeval now + { + }; Utility::gettimeofday(&now); if (d_deadline >= now.tv_sec) { d_func(now, logErrors, *this); diff --git a/pdns/recursordist/ws-recursor.cc b/pdns/recursordist/ws-recursor.cc index 324928b888..9e711c164f 100644 --- a/pdns/recursordist/ws-recursor.cc +++ b/pdns/recursordist/ws-recursor.cc @@ -525,16 +525,19 @@ static void serveStuff(HttpRequest* req, HttpResponse* resp) if (req->url.path == "/") { req->url.path = "/index.html"; -} + } const string charset = "; charset=utf-8"; if (boost::ends_with(req->url.path, ".html")) { resp->headers["Content-Type"] = "text/html" + charset; - } else if (boost::ends_with(req->url.path, ".css")) { + } + else if (boost::ends_with(req->url.path, ".css")) { resp->headers["Content-Type"] = "text/css" + charset; - } else if (boost::ends_with(req->url.path, ".js")) { + } + else if (boost::ends_with(req->url.path, ".js")) { resp->headers["Content-Type"] = "application/javascript" + charset; - } else if (boost::ends_with(req->url.path, ".png")) { + } + else if (boost::ends_with(req->url.path, ".png")) { resp->headers["Content-Type"] = "image/png"; } @@ -1288,7 +1291,8 @@ void RecursorWebServer::jsonstat(HttpRequest* req, HttpResponse* resp) for (const query_t& count : queries) { if (filter) { counts[pair(getRegisteredName(count.first), count.second)]++; - } else { + } + else { counts[pair(count.first, count.second)]++; } } @@ -1309,7 +1313,7 @@ void RecursorWebServer::jsonstat(HttpRequest* req, HttpResponse* resp) -count.first, count.second.first.toLogString(), DNSRecordContent::NumberToType(count.second.second)}); if (tot++ >= 100) { break; -} + } } if (queries.size() != totIncluded) { entries.push_back(Json::array{ @@ -1322,13 +1326,17 @@ void RecursorWebServer::jsonstat(HttpRequest* req, HttpResponse* resp) vector queries; if (req->getvars["name"] == "remotes") { queries = broadcastAccFunction>(pleaseGetRemotes); - } else if (req->getvars["name"] == "servfail-remotes") { + } + else if (req->getvars["name"] == "servfail-remotes") { queries = broadcastAccFunction>(pleaseGetServfailRemotes); - } else if (req->getvars["name"] == "bogus-remotes") { + } + else if (req->getvars["name"] == "bogus-remotes") { queries = broadcastAccFunction>(pleaseGetBogusRemotes); - } else if (req->getvars["name"] == "large-answer-remotes") { + } + else if (req->getvars["name"] == "large-answer-remotes") { queries = broadcastAccFunction>(pleaseGetLargeAnswerRemotes); - } else if (req->getvars["name"] == "timeouts") { + } + else if (req->getvars["name"] == "timeouts") { queries = broadcastAccFunction>(pleaseGetTimeouts); } typedef map counts_t; @@ -1350,7 +1358,7 @@ void RecursorWebServer::jsonstat(HttpRequest* req, HttpResponse* resp) for (const rcounts_t::value_type& count : rcounts) { totIncluded -= count.first; entries.push_back(Json::array{ - -count.first, count.second.toString()}); // NOLINT: union + -count.first, count.second.toString()}); // NOLINT: union if (tot++ >= 100) { break; } @@ -1402,7 +1410,7 @@ void AsyncServer::newConnection() } // This is an entry point from FDM, so it needs to catch everything. -void AsyncWebServer::serveConnection(const std::shared_ptr& socket) const +void AsyncWebServer::serveConnection(const std::shared_ptr& socket) const // NOLINT(readability-function-cognitive-complexity) #12791 Remove NOLINT(readability-function-cognitive-complexity) omoerbeek { if (!socket->acl(d_acl)) { return; diff --git a/pdns/recursordist/ws-recursor.hh b/pdns/recursordist/ws-recursor.hh index 7821f10746..18ab40b5b7 100644 --- a/pdns/recursordist/ws-recursor.hh +++ b/pdns/recursordist/ws-recursor.hh @@ -39,7 +39,7 @@ public: friend void AsyncServerNewConnectionMT(void* arg); - using newconnectioncb_t = std::function&)>; + using newconnectioncb_t = std::function&)>; void asyncWaitForConnections(FDMultiplexer* fdm, const newconnectioncb_t& callback); private: