]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Reformat
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Wed, 10 May 2023 07:44:52 +0000 (09:44 +0200)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Wed, 31 May 2023 09:46:16 +0000 (11:46 +0200)
pdns/recursordist/taskqueue.cc
pdns/recursordist/ws-recursor.cc
pdns/recursordist/ws-recursor.hh

index d18a8cb8c9cab181f6ba3117931a9fcdad88c94a..7e268e4edfd9cb476965b24b8cbcfc8d14968c92 100644 (file)
@@ -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);
index 324928b88894e2ef6881f36e503e1be7393efb12..9e711c164f9cdc2696a00c46bd88ebb2df89b433 100644 (file)
@@ -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<ComboAddress> queries;
     if (req->getvars["name"] == "remotes") {
       queries = broadcastAccFunction<vector<ComboAddress>>(pleaseGetRemotes);
-    } else if (req->getvars["name"] == "servfail-remotes") {
+    }
+    else if (req->getvars["name"] == "servfail-remotes") {
       queries = broadcastAccFunction<vector<ComboAddress>>(pleaseGetServfailRemotes);
-    } else if (req->getvars["name"] == "bogus-remotes") {
+    }
+    else if (req->getvars["name"] == "bogus-remotes") {
       queries = broadcastAccFunction<vector<ComboAddress>>(pleaseGetBogusRemotes);
-    } else if (req->getvars["name"] == "large-answer-remotes") {
+    }
+    else if (req->getvars["name"] == "large-answer-remotes") {
       queries = broadcastAccFunction<vector<ComboAddress>>(pleaseGetLargeAnswerRemotes);
-    } else if (req->getvars["name"] == "timeouts") {
+    }
+    else if (req->getvars["name"] == "timeouts") {
       queries = broadcastAccFunction<vector<ComboAddress>>(pleaseGetTimeouts);
     }
     typedef map<ComboAddress, unsigned int, ComboAddress::addressOnlyLessThan> 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>& socket) const
+void AsyncWebServer::serveConnection(const std::shared_ptr<Socket>& socket) const // NOLINT(readability-function-cognitive-complexity) #12791 Remove NOLINT(readability-function-cognitive-complexity) omoerbeek
 {
   if (!socket->acl(d_acl)) {
     return;
index 7821f10746ed355b8733e3419c50625467cd856f..18ab40b5b7fc7f10b79d7740469adc64eca2c339 100644 (file)
@@ -39,7 +39,7 @@ public:
 
   friend void AsyncServerNewConnectionMT(void* arg);
 
-  using newconnectioncb_t = std::function<void (const std::shared_ptr<Socket>&)>;
+  using newconnectioncb_t = std::function<void(const std::shared_ptr<Socket>&)>;
   void asyncWaitForConnections(FDMultiplexer* fdm, const newconnectioncb_t& callback);
 
 private: