From 2a0826d3c523a79a76f7c64f24866692d1f0aa6e Mon Sep 17 00:00:00 2001 From: Charles-Henri Bruyand Date: Fri, 9 Feb 2024 13:27:38 +0100 Subject: [PATCH] ixfrdist: clang-tidy cleanup --- pdns/ixfrdist.cc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pdns/ixfrdist.cc b/pdns/ixfrdist.cc index c7314e8275..47203b7cc8 100644 --- a/pdns/ixfrdist.cc +++ b/pdns/ixfrdist.cc @@ -37,6 +37,8 @@ #include #include #include +#include +#include #include "ixfr.hh" #include "ixfrutils.hh" #include "axfr-retriever.hh" @@ -317,7 +319,7 @@ static void communicatorReceiveNotificationAnswers(const int sock4, const int so { std::set fds = {sock4, sock6}; ComboAddress from; - std::array buffer; + std::array buffer{}; int sock{-1}; // receive incoming notification answers on the nonblocking sockets and take them off the list @@ -341,7 +343,7 @@ static void communicatorReceiveNotificationAnswers(const int sock4, const int so } if (g_notificationQueue.lock()->removeIf(from, packet.d.id, packet.qdomain)) { - g_log << Logger::Notice << "Removed from notification list: '" << packet.qdomain << "' to " << from.toStringWithPort() << " " << (packet.d.rcode ? RCode::to_s(packet.d.rcode) : "(was acknowledged)") << endl; + g_log << Logger::Notice << "Removed from notification list: '" << packet.qdomain << "' to " << from.toStringWithPort() << " " << (packet.d.rcode != 0 ? RCode::to_s(packet.d.rcode) : "(was acknowledged)") << endl; } else { g_log << Logger::Warning << "Received spurious notify answer for '" << packet.qdomain << "' from " << from.toStringWithPort() << endl; @@ -379,7 +381,7 @@ static void communicatorThread() } communicatorReceiveNotificationAnswers(sock4, sock6); communicatorSendNotifications(sock4, sock6); - sleep(1); + std::this_thread::sleep_for(std::chrono::seconds(1)); } closesocket(sock4); closesocket(sock6); @@ -1467,6 +1469,7 @@ struct IXFRDistConfiguration bool shouldExit{false}; }; +// NOLINTNEXTLINE(readability-function-cognitive-complexity) static std::optional parseConfiguration(int argc, char** argv, FDMultiplexer& fdm) { IXFRDistConfiguration configuration; -- 2.47.2