]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
auth: rename TN to s_tcpNameserver and make static
authorChris Hofstaedtler <chris.hofstaedtler@deduktiva.com>
Wed, 3 Aug 2022 19:49:52 +0000 (21:49 +0200)
committerChris Hofstaedtler <chris.hofstaedtler@deduktiva.com>
Sat, 10 Sep 2022 10:28:16 +0000 (12:28 +0200)
pdns/auth-main.cc
pdns/auth-main.hh

index 49ef12d5e9877252e8c81a5fcea1b1987bf66fd7..65fb75b6c273f22b1bf395fcd6d679fef3e9b4fd 100644 (file)
@@ -123,7 +123,7 @@ std::unique_ptr<DNSProxy> DP{nullptr};
 static std::unique_ptr<DynListener> dl{nullptr};
 CommunicatorClass Communicator;
 static double avg_latency{0.0}, receive_latency{0.0}, cache_latency{0.0}, backend_latency{0.0}, send_latency{0.0};
-unique_ptr<TCPNameserver> TN;
+static unique_ptr<TCPNameserver> s_tcpNameserver{nullptr};
 static vector<DNSDistributor*> g_distributors;
 static shared_ptr<UDPNameserver> s_udpNameserver{nullptr};
 static vector<std::shared_ptr<UDPNameserver>> g_udpReceivers;
@@ -356,7 +356,7 @@ static uint64_t getSysUserTimeMsec(const std::string& str)
 
 static uint64_t getTCPConnectionCount(const std::string& str)
 {
-  return TN->numTCPConnections();
+  return s_tcpNameserver->numTCPConnections();
 }
 
 static uint64_t getQCount(const std::string& str)
@@ -853,7 +853,7 @@ static void mainthread()
   if (::arg().mustDo("primary") || ::arg().mustDo("secondary") || !::arg()["forward-notify"].empty())
     Communicator.go();
 
-  TN->go(); // tcp nameserver launch
+  s_tcpNameserver->go(); // tcp nameserver launch
 
   unsigned int max_rthreads = ::arg().asNum("receiver-threads", 1);
   g_distributors.resize(max_rthreads);
@@ -1464,7 +1464,7 @@ int main(int argc, char** argv)
       }
     }
 
-    TN = make_unique<TCPNameserver>();
+    s_tcpNameserver = make_unique<TCPNameserver>();
   }
   catch (const ArgException& A) {
     g_log << Logger::Error << "Fatal error: " << A.reason << endl;
index 47d7ecd1b6f50641fd2f575692a2e4dd13cb423c..5d194dc36878f53540d7a0f489cd5a92f5671763 100644 (file)
@@ -42,7 +42,6 @@ extern AuthPacketCache PC; //!< This is the main PacketCache, shared across all
 extern AuthQueryCache QC;
 extern std::unique_ptr<DNSProxy> DP;
 extern CommunicatorClass Communicator;
-extern std::unique_ptr<TCPNameserver> TN;
 extern bool g_anyToTcp;
 extern bool g_8bitDNS;
 extern NetmaskGroup g_proxyProtocolACL;