From: Otto Moerbeek Date: Tue, 10 Dec 2024 09:20:58 +0000 (+0100) Subject: Add comments about the prupose of the added arguments to make{UDP,TCP}ServerSockets X-Git-Tag: rec-5.2.0-rc1~2^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F14942%2Fhead;p=thirdparty%2Fpdns.git Add comments about the prupose of the added arguments to make{UDP,TCP}ServerSockets --- diff --git a/pdns/recursordist/pdns_recursor.cc b/pdns/recursordist/pdns_recursor.cc index f395ad7aca..8ea9286171 100644 --- a/pdns/recursordist/pdns_recursor.cc +++ b/pdns/recursordist/pdns_recursor.cc @@ -2682,6 +2682,7 @@ static void handleNewUDPQuestion(int fileDesc, FDMultiplexer::funcparam_t& /* va t_Counters.updateSnap(g_regressionTestMode); } +// The two last arguments to makeUDPServerSockets are used for logging purposes only unsigned int makeUDPServerSockets(deferredAdd_t& deferredAdds, Logr::log_t log, bool doLog, unsigned int instances) { int one = 1; diff --git a/pdns/recursordist/rec-main.cc b/pdns/recursordist/rec-main.cc index b06a55c04d..315f534df2 100644 --- a/pdns/recursordist/rec-main.cc +++ b/pdns/recursordist/rec-main.cc @@ -1891,6 +1891,7 @@ static unsigned int initDistribution(Logr::log_t log) for (unsigned int i = 0; i < RecThreadInfo::numDistributors(); i++, threadNum++) { auto& info = RecThreadInfo::info(threadNum); auto& deferredAdds = info.getDeferredAdds(); + // The two last arguments to make{UDP,TCP}ServerSockets are used for logging purposes only, same for calls below count += makeUDPServerSockets(deferredAdds, log, i == RecThreadInfo::numDistributors() - 1, RecThreadInfo::numDistributors()); } } diff --git a/pdns/recursordist/rec-tcp.cc b/pdns/recursordist/rec-tcp.cc index 5fc4ec5d4a..eeb4b59983 100644 --- a/pdns/recursordist/rec-tcp.cc +++ b/pdns/recursordist/rec-tcp.cc @@ -1086,6 +1086,7 @@ LWResult::Result arecvtcp(PacketBuffer& data, const size_t len, shared_ptr& tcpSockets, Logr::log_t log, bool doLog, unsigned int instances) { vector localAddresses;