]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
dnsdist: Use a unique pointer for the global TCPClientCollection
authorRemi Gacogne <remi.gacogne@powerdns.com>
Wed, 20 Mar 2019 11:09:28 +0000 (12:09 +0100)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Thu, 4 Apr 2019 09:54:04 +0000 (11:54 +0200)
pdns/dnsdist-tcp.cc
pdns/dnsdist.cc
pdns/dnsdist.hh

index b8e8d591d6190ce58282e35522a64866b6d76a7f..78d45b219a1e49ff272fb3f60d0d97443910450e 100644 (file)
@@ -302,7 +302,7 @@ IOState tryRead(int fd, std::vector<uint8_t>& buffer, size_t& pos, size_t toRead
   return IOState::Done;
 }
 
-std::shared_ptr<TCPClientCollection> g_tcpclientthreads;
+std::unique_ptr<TCPClientCollection> g_tcpclientthreads;
 
 class TCPClientThreadData
 {
index acb4647786b4687d91c191a316bc86f35e4f72bb..905ee4d4151e48638f3621f62ad02328bb02df83 100644 (file)
@@ -2795,7 +2795,7 @@ try
     g_snmpAgent->run();
   }
 
-  g_tcpclientthreads = std::make_shared<TCPClientCollection>(g_maxTCPClientThreads, g_useTCPSinglePipe);
+  g_tcpclientthreads = std::unique_ptr<TCPClientCollection>(new TCPClientCollection(g_maxTCPClientThreads, g_useTCPSinglePipe));
 
   for(auto& t : todo)
     t();
index 7757e692880a5a4d8e33942643b350b14879f225..eed5d469401d4883bb82ed2c987d40e51636efc4 100644 (file)
@@ -669,7 +669,7 @@ public:
   void addTCPClientThread();
 };
 
-extern std::shared_ptr<TCPClientCollection> g_tcpclientthreads;
+extern std::unique_ptr<TCPClientCollection> g_tcpclientthreads;
 
 struct DownstreamState
 {