Skip to content

Commit

Permalink
remove unused branch in SLOG macro (ifdef RECURSOR)
Browse files Browse the repository at this point in the history
  • Loading branch information
omoerbeek committed Mar 25, 2024
1 parent 2b23ecf commit fbc34aa
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 18 deletions.
7 changes: 1 addition & 6 deletions pdns/logging.hh
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
10 changes: 1 addition & 9 deletions pdns/recursordist/pdns_recursor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down Expand Up @@ -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")) {
Expand Down
6 changes: 3 additions & 3 deletions pdns/recursordist/rpzloader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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 */
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit fbc34aa

Please sign in to comment.