]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
remove unused branch in SLOG macro (ifdef RECURSOR)
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Fri, 1 Mar 2024 14:36:13 +0000 (15:36 +0100)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Mon, 25 Mar 2024 09:49:37 +0000 (10:49 +0100)
pdns/logging.hh
pdns/recursordist/pdns_recursor.cc
pdns/recursordist/rpzloader.cc

index edde72d4b39143a1d717976a5cfcbf0fa3e88c2a..2f1d0f2c7802d3ea808b55a5643001e84185c662 100644 (file)
@@ -220,12 +220,7 @@ constexpr bool g_slogStructured = true;
 // NOLINTNEXTLINE(cppcoreguidelines-macro-usage)
 #define SLOG(oldStyle, slogCall) \
   do {                           \
-    if (g_slogStructured) {      \
-      slogCall;                  \
-    }                            \
-    else {                       \
-      oldStyle;                  \
-    }                            \
+    slogCall;                    \
   } while (0)
 
 #else // No structured logging (e.g. auth)
index fc22f0dfbdb438adb08eb1b78e1ee403be4c69c2..6f08ad4983f49a53635d46a05fca754aeffd7926 100644 (file)
@@ -388,14 +388,6 @@ static void updateResponseStats(int res, const ComboAddress& remote, unsigned in
   }
 }
 
-static string makeLoginfo(const std::unique_ptr<DNSComboWriter>& comboWriter)
-try {
-  return "(" + comboWriter->d_mdp.d_qname.toLogString() + "/" + DNSRecordContent::NumberToType(comboWriter->d_mdp.d_qtype) + " from " + (comboWriter->getRemote()) + ")";
-}
-catch (...) {
-  return "Exception making error message for exception";
-}
-
 /**
  * Chases the CNAME provided by the PolicyCustom RPZ policy.
  *
@@ -2675,7 +2667,7 @@ void makeUDPServerSockets(deferredAdd_t& deferredAdds, Logr::log_t log)
       if (address.sin6.sin6_family == AF_INET6 && setsockopt(socketFd, IPPROTO_IPV6, IPV6_V6ONLY, &one, sizeof(one)) < 0) {
         int err = errno;
         SLOG(g_log << Logger::Warning << "Failed to set IPv6 socket to IPv6 only, continuing anyhow: " << stringerror(err) << endl,
-             log->error(Logr::Warning, "Failed to set IPv6 socket to IPv6 only, continuing anyhow"));
+             log->error(Logr::Warning, err, "Failed to set IPv6 socket to IPv6 only, continuing anyhow"));
       }
     }
     if (::arg().mustDo("non-local-bind")) {
index 478631363e8fdcc6262aa156eae3de60cc4aacc5..4b28464edb355068f9a845021b797db23f1e0292 100644 (file)
@@ -377,7 +377,7 @@ std::shared_ptr<const SOARecordContent> loadRPZFromFile(const std::string& fname
   return soaRecordContent;
 }
 
-static bool dumpZoneToDisk(Logr::log_t logger, const DNSName& zoneName, const std::shared_ptr<DNSFilterEngine::Zone>& newZone, const std::string& dumpZoneFileName)
+static bool dumpZoneToDisk(Logr::log_t logger, const std::shared_ptr<DNSFilterEngine::Zone>& newZone, const std::string& dumpZoneFileName)
 {
   logger->info(Logr::Debug, "Dumping zone to disk", "destination_file", Logging::Loggable(dumpZoneFileName));
   std::string temp = dumpZoneFileName + "XXXXXX";
@@ -465,7 +465,7 @@ static void preloadRPZFIle(RPZTrackerParams& params, const DNSName& zoneName, st
         });
 
         if (!params.dumpZoneFileName.empty()) {
-          dumpZoneToDisk(logger, zoneName, newZone, params.dumpZoneFileName);
+          dumpZoneToDisk(logger, newZone, params.dumpZoneFileName);
         }
 
         /* no need to try another primary */
@@ -659,7 +659,7 @@ static bool RPZTrackerIteration(RPZTrackerParams& params, const DNSName& zoneNam
     });
 
     if (!params.dumpZoneFileName.empty()) {
-      dumpZoneToDisk(logger, zoneName, newZone, params.dumpZoneFileName);
+      dumpZoneToDisk(logger, newZone, params.dumpZoneFileName);
     }
     refresh = std::max(params.refreshFromConf != 0 ? params.refreshFromConf : newZone->getRefresh(), 1U);
   }