From: Otto Moerbeek Date: Mon, 30 Jan 2023 11:07:12 +0000 (+0100) Subject: Reformat X-Git-Tag: dnsdist-1.8.0-rc1~38^2~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f7e9e4db5f5633078f9ebb787c6e78a8c73cc2d1;p=thirdparty%2Fpdns.git Reformat --- diff --git a/pdns/logger.cc b/pdns/logger.cc index e290a2c9e6..0711b971b0 100644 --- a/pdns/logger.cc +++ b/pdns/logger.cc @@ -206,7 +206,7 @@ Logger& Logger::operator<<(const ComboAddress& ca) #ifdef RECURSOR void addTraceTS(const timeval& start, ostringstream& str) { - const auto & content = str.str(); + const auto& content = str.str(); if (content.empty() || content.at(content.size() - 1) == '\n') { timeval time{}; gettimeofday(&time, nullptr); diff --git a/pdns/logger.hh b/pdns/logger.hh index 718a7f47c4..5e2f45dea5 100644 --- a/pdns/logger.hh +++ b/pdns/logger.hh @@ -183,7 +183,6 @@ struct LogVariant using OptLog = std::optional; - #ifndef RECURSOR // Originally there was a flag but it was never set from !RECURSOR #define VLOG(log, x) VLOG only works in recursor @@ -191,26 +190,26 @@ using OptLog = std::optional; void addTraceTS(const timeval& start, ostringstream& str); -#define VLOG(log, x) \ - if (log) { \ - if (std::holds_alternative((log)->v)) { \ +#define VLOG(log, x) \ + if (log) { \ + if (std::holds_alternative((log)->v)) { \ *std::get(log->v) << Logger::Warning << (log)->prefix << x; \ - } \ - else if (std::holds_alternative((log)->v)) { \ - addTraceTS((log)->start, *std::get((log)->v)); \ - *std::get((log)->v) << (log)->prefix << x; \ - } \ + } \ + else if (std::holds_alternative((log)->v)) { \ + addTraceTS((log)->start, *std::get((log)->v)); \ + *std::get((log)->v) << (log)->prefix << x; \ + } \ } -#define VLOG_NO_PREFIX(log, x) \ - if (log) { \ - if (std::holds_alternative((log)->v)) { \ - *std::get(log->v) << Logger::Warning << x; \ - } \ - else if (std::holds_alternative((log)->v)) { \ - addTraceTS((log)->start, *std::get((log)->v)); \ - *std::get((log)->v) << x; \ - } \ +#define VLOG_NO_PREFIX(log, x) \ + if (log) { \ + if (std::holds_alternative((log)->v)) { \ + *std::get(log->v) << Logger::Warning << x; \ + } \ + else if (std::holds_alternative((log)->v)) { \ + addTraceTS((log)->start, *std::get((log)->v)); \ + *std::get((log)->v) << x; \ + } \ } #endif diff --git a/pdns/recursordist/syncres.cc b/pdns/recursordist/syncres.cc index a9c1d4aef5..41442d59da 100644 --- a/pdns/recursordist/syncres.cc +++ b/pdns/recursordist/syncres.cc @@ -469,13 +469,13 @@ bool SyncRes::s_save_parent_ns_set; unsigned int SyncRes::s_max_busy_dot_probes; bool SyncRes::s_addExtendedResolutionDNSErrors; -#define LOG(x) \ - if (d_lm == Log) { \ - g_log << Logger::Warning << x; \ - } \ - else if (d_lm == Store) { \ - addTraceTS(d_fixednow, d_trace); \ - d_trace << x; \ +#define LOG(x) \ + if (d_lm == Log) { \ + g_log << Logger::Warning << x; \ + } \ + else if (d_lm == Store) { \ + addTraceTS(d_fixednow, d_trace); \ + d_trace << x; \ } OptLog SyncRes::LogObject(const string& prefix) @@ -485,7 +485,7 @@ OptLog SyncRes::LogObject(const string& prefix) ret = {prefix, d_fixednow, &g_log}; } else if (d_lm == Store) { - ret = {prefix, d_now, &d_trace}; + ret = {prefix, d_fixednow, &d_trace}; } return ret; } @@ -3010,7 +3010,7 @@ std::vector> SyncRes::shuffleInSpeedOrder(const DNSNam return rnameservers; } -vector SyncRes::shuffleForwardSpeed(const DNSName &qname, const vector& rnameservers, const string& prefix, const bool wasRd) +vector SyncRes::shuffleForwardSpeed(const DNSName& qname, const vector& rnameservers, const string& prefix, const bool wasRd) { vector nameservers = rnameservers; map speeds;