]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Formatting
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Tue, 17 May 2022 08:43:10 +0000 (10:43 +0200)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Wed, 18 May 2022 09:57:39 +0000 (11:57 +0200)
pdns/logging.hh
pdns/pdns_recursor.cc
pdns/rec_control.cc
pdns/recursordist/logging.cc
pdns/recursordist/rec-main.cc
pdns/recursordist/rec-tcp.cc
pdns/reczones.cc

index d2ab31ca58ede2a6f3265a8ca152b7b65b140aa8..d8ff96a2d78fbd2e918e8cf0923f22966ca1e541 100644 (file)
@@ -145,6 +145,6 @@ extern bool g_slogStructured;
 #else // No structured logging (e.g. auth)
 #define SLOG(oldStyle, slogCall) \
   do {                           \
-      oldStyle;                  \
+    oldStyle;                    \
   } while (0);
-#endif
+#endif // RECURSOR
index 2e3b840d548c4455ee79c4324345e89c5d3a6532..55d55f9b03c8e5f13cb5406e8afd7e4dda9a73b0 100644 (file)
@@ -2319,7 +2319,7 @@ void makeUDPServerSockets(deferredAdd_t& deferredAdds, std::shared_ptr<Logr::Log
     }
     if (!setSocketTimestamps(fd)) {
       SLOG(g_log << Logger::Warning << "Unable to enable timestamp reporting for socket" << endl,
-           log->info(Logr::Warning,  "Unable to enable timestamp reporting for socket"));
+           log->info(Logr::Warning, "Unable to enable timestamp reporting for socket"));
     }
     if (IsAnyAddress(sin)) {
       if (sin.sin4.sin_family == AF_INET)
index 386a69589897748ea08677d116611ae6372de732..862ba00c14477071c7e841fe290a7f3f1e4260df 100644 (file)
@@ -85,7 +85,6 @@ static void initArguments(int argc, char** argv)
   }
 }
 
-
 int main(int argc, char** argv)
 {
   g_slogStructured = false;
index 5b49d2a61e1c83625db636a09228bf1188d248c0..f6083df59c5bbc656fe3069db5cca1799d1ea75d 100644 (file)
@@ -134,7 +134,8 @@ std::string Loggable<std::vector<std::string>>::to_string() const
   for (const auto& e : _t) {
     if (!first) {
       oss << ' ';
-    } else {
+    }
+    else {
       first = false;
     }
     oss << e;
index 28aeefdffd9e41042f9484accaa4c1d5cc12f113..b00a0af1fc334c508703cb61efb10bc049bf899b 100644 (file)
@@ -953,8 +953,8 @@ static std::shared_ptr<NetmaskGroup> parseACL(const std::string& aclFile, const
     }
     SLOG(g_log << Logger::Info << "Done parsing " << result->size() << " " << aclSetting << " ranges from file '" << ::arg()[aclFile] << "' - overriding '" << aclSetting << "' setting" << endl,
          log->info(Logr::Info, "Done parsing ranges from file, will override setting", "setting", Logging::Loggable(aclSetting),
-                   "number",  Logging::Loggable(result->size()), "file", Logging::Loggable(::arg()[aclFile])));
-    }
+                   "number", Logging::Loggable(result->size()), "file", Logging::Loggable(::arg()[aclFile])));
+  }
   else if (!::arg()[aclSetting].empty()) {
     vector<string> ips;
     stringtok(ips, ::arg()[aclSetting], ", ");
@@ -1560,7 +1560,7 @@ static int serviceMain(int argc, char* argv[], std::shared_ptr<Logr::Logger>& lo
 #ifndef HAVE_DNS_OVER_TLS
     if (parts.size()) {
       SLOG(g_log << Logger::Error << "dot-to-auth-names setting contains names, but Recursor was built without DNS over TLS support. Setting will be ignored." << endl,
-           log->info(Logr::Error,  "dot-to-auth-names setting contains names, but Recursor was built without DNS over TLS support. Setting will be ignored"));
+           log->info(Logr::Error, "dot-to-auth-names setting contains names, but Recursor was built without DNS over TLS support. Setting will be ignored"));
     }
 #endif
     for (const auto& p : parts) {
@@ -1716,12 +1716,12 @@ static int serviceMain(int argc, char* argv[], std::shared_ptr<Logr::Logger>& lo
     if (chroot(::arg()["chroot"].c_str()) < 0 || chdir("/") < 0) {
       int err = errno;
       SLOG(g_log << Logger::Error << "Unable to chroot to '" + ::arg()["chroot"] + "': " << strerror(err) << ", exiting" << endl,
-           log->error(Logr::Error, err,  "Unable to chroot", "chroot", Logging::Loggable(::arg()["chroot"])));
+           log->error(Logr::Error, err, "Unable to chroot", "chroot", Logging::Loggable(::arg()["chroot"])));
       exit(1);
     }
     else {
       SLOG(g_log << Logger::Info << "Chrooted to '" << ::arg()["chroot"] << "'" << endl,
-           log->info(Logr::Info, "Chrooted", "chroot",  Logging::Loggable(::arg()["chroot"])));
+           log->info(Logr::Info, "Chrooted", "chroot", Logging::Loggable(::arg()["chroot"])));
     }
   }
 
@@ -1798,7 +1798,7 @@ static int serviceMain(int argc, char* argv[], std::shared_ptr<Logr::Logger>& lo
     port = std::stoi(part);
     if (port < 1024 || port > 65535) {
       SLOG(g_log << Logger::Error << "Unable to launch, udp-source-port-avoid contains an invalid port number: " << part << endl,
-           log->info(Logr::Error,  "Unable to launch, udp-source-port-avoid contains an invalid port number", "port", Logging::Loggable(part)));
+           log->info(Logr::Error, "Unable to launch, udp-source-port-avoid contains an invalid port number", "port", Logging::Loggable(part)));
       exit(99); // this isn't going to fix itself either
     }
     g_avoidUdpSourcePorts.insert(port);
@@ -2680,7 +2680,6 @@ int main(int argc, char** argv)
     logUrgency = (Logger::Urgency)::arg().asNum("loglevel");
     g_slogStructured = ::arg().mustDo("structured-logging");
 
-
     if (logUrgency < Logger::Error)
       logUrgency = Logger::Error;
     if (!g_quiet && logUrgency < Logger::Info) { // Logger::Info=6, Logger::Debug=7
index 96ad1325863ff2c7336c446d10b051340c312831..f3ae5393ab52a4f3c1db655da0be836cde2cc27d 100644 (file)
@@ -1040,6 +1040,7 @@ void makeTCPServerSockets(deferredAdd_t& deferredAdds, std::set<int>& tcpSockets
       if (i == locals.begin()) {
         SLOG(g_log << Logger::Info << "Enabled TCP data-ready filter for (slight) DoS protection" << endl,
              log->info(Logr::Info, "Enabled TCP data-ready filter for (slight) DoS protection"));
+      }
     }
 #endif
 
index f50cec976eb72c78a5dffd3e4dd9afad029e2612..bcad1a34148c6908f96b1cd89318546fa9e197e4 100644 (file)
@@ -159,7 +159,7 @@ bool primeHints(time_t ignored)
     }
     if (SyncRes::s_doIPv4 && SyncRes::s_doIPv6 && !reachableA && !reachableAAAA) {
       SLOG(g_log << Logger::Error << "No valid root hints" << endl,
-           log->info(Logr::Error,  "No valid root hints"));
+           log->info(Logr::Error, "No valid root hints"));
       return false;
     }
   }
@@ -222,11 +222,11 @@ static void makeNameToIPZone(std::shared_ptr<SyncRes::domainmap_t> newMap, const
 
   if (newMap->count(dr.d_name)) {
     SLOG(g_log << Logger::Warning << "Hosts file will not overwrite zone '" << dr.d_name << "' already loaded" << endl,
-         log->info(Logr::Warning, "Hosts file will not overwrite already loaded zone", "zone", Logging::Loggable( dr.d_name)));
+         log->info(Logr::Warning, "Hosts file will not overwrite already loaded zone", "zone", Logging::Loggable(dr.d_name)));
   }
   else {
     SLOG(g_log << Logger::Warning << "Inserting forward zone '" << dr.d_name << "' based on hosts file" << endl,
-         log->info(Logr::Warning,  "Inserting forward zone based on hosts file", "zone", Logging::Loggable(dr.d_name)));
+         log->info(Logr::Warning, "Inserting forward zone based on hosts file", "zone", Logging::Loggable(dr.d_name)));
     ad.d_name = dr.d_name;
     (*newMap)[ad.d_name] = ad;
   }
@@ -305,9 +305,10 @@ static void convertServersForAD(const std::string& zone, const std::string& inpu
       g_log << "to: ";
       bool first = true;
       for (const auto& a : addresses) {
-        if (!first ) {
+        if (!first) {
           g_log << ", ";
-        } else {
+        }
+        else {
           first = false;
         }
         g_log << a;
@@ -330,7 +331,7 @@ string reloadZoneConfiguration()
 {
   std::shared_ptr<SyncRes::domainmap_t> original = SyncRes::getDomainMap();
   auto log = g_slog->withName("config");
-  
+
   try {
     SLOG(g_log << Logger::Warning << "Reloading zones, purging data from cache" << endl,
          log->info(Logr::Warning, "Reloading zones, purging data from cache"));
@@ -413,7 +414,7 @@ string reloadZoneConfiguration()
   }
   catch (...) {
     SLOG(g_log << Logger::Error << "Encountered unknown error reloading zones, keeping original data" << endl,
-          log->error(Logr::Error, "Exception", "Encountered error reloading zones, keeping original data"));
+         log->error(Logr::Error, "Exception", "Encountered error reloading zones, keeping original data"));
   }
   return "reloading failed, see log\n";
 }
@@ -445,7 +446,7 @@ std::tuple<std::shared_ptr<SyncRes::domainmap_t>, std::shared_ptr<notifyset_t>>
       if (n == 0) {
         ad.d_rdForward = false;
         SLOG(g_log << Logger::Error << "Parsing authoritative data for zone '" << headers.first << "' from file '" << headers.second << "'" << endl,
-             log->info(Logr::Error, "Parsing authoritative data from file", "zone", Logging::Loggable(headers.first), "file",  Logging::Loggable(headers.second)));
+             log->info(Logr::Error, "Parsing authoritative data from file", "zone", Logging::Loggable(headers.first), "file", Logging::Loggable(headers.second)));
         ZoneParserTNG zpt(headers.second, DNSName(headers.first));
         zpt.setMaxGenerateSteps(::arg().asNum("max-generate-steps"));
         zpt.setMaxIncludes(::arg().asNum("max-include-depth"));
@@ -478,7 +479,7 @@ std::tuple<std::shared_ptr<SyncRes::domainmap_t>, std::shared_ptr<notifyset_t>>
 
   if (!::arg()["forward-zones-file"].empty()) {
     SLOG(g_log << Logger::Warning << "Reading zone forwarding information from '" << ::arg()["forward-zones-file"] << "'" << endl,
-         log->info(Logr::Warning, "Reading zone forwarding information", "file", Logging::Loggable( ::arg()["forward-zones-file"])));
+         log->info(Logr::Warning, "Reading zone forwarding information", "file", Logging::Loggable(::arg()["forward-zones-file"])));
     auto fp = std::unique_ptr<FILE, int (*)(FILE*)>(fopen(::arg()["forward-zones-file"].c_str(), "r"), fclose);
     if (!fp) {
       throw PDNSException("Error opening forward-zones-file '" + ::arg()["forward-zones-file"] + "': " + stringerror());
@@ -536,7 +537,7 @@ std::tuple<std::shared_ptr<SyncRes::domainmap_t>, std::shared_ptr<notifyset_t>>
       }
     }
     SLOG(g_log << Logger::Warning << "Done parsing " << newMap->size() - before << " forwarding instructions from file '" << ::arg()["forward-zones-file"] << "'" << endl,
-         log->info(Logr::Warning, "Done parsing forwarding instructions from file", "file", Logging::Loggable(::arg()["forward-zones-file"]), "count",  Logging::Loggable( newMap->size() - before)));
+         log->info(Logr::Warning, "Done parsing forwarding instructions from file", "file", Logging::Loggable(::arg()["forward-zones-file"]), "count", Logging::Loggable(newMap->size() - before)));
   }
 
   if (::arg().mustDo("export-etc-hosts")) {