From: Remi Gacogne Date: Wed, 20 Mar 2019 11:09:28 +0000 (+0100) Subject: dnsdist: Use a unique pointer for the global TCPClientCollection X-Git-Tag: dnsdist-1.4.0-alpha1~25^2~21 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1f7646c2162c3f8e2b9d2a3b341cb12a377fc657;p=thirdparty%2Fpdns.git dnsdist: Use a unique pointer for the global TCPClientCollection --- diff --git a/pdns/dnsdist-tcp.cc b/pdns/dnsdist-tcp.cc index b8e8d591d6..78d45b219a 100644 --- a/pdns/dnsdist-tcp.cc +++ b/pdns/dnsdist-tcp.cc @@ -302,7 +302,7 @@ IOState tryRead(int fd, std::vector& buffer, size_t& pos, size_t toRead return IOState::Done; } -std::shared_ptr g_tcpclientthreads; +std::unique_ptr g_tcpclientthreads; class TCPClientThreadData { diff --git a/pdns/dnsdist.cc b/pdns/dnsdist.cc index acb4647786..905ee4d415 100644 --- a/pdns/dnsdist.cc +++ b/pdns/dnsdist.cc @@ -2795,7 +2795,7 @@ try g_snmpAgent->run(); } - g_tcpclientthreads = std::make_shared(g_maxTCPClientThreads, g_useTCPSinglePipe); + g_tcpclientthreads = std::unique_ptr(new TCPClientCollection(g_maxTCPClientThreads, g_useTCPSinglePipe)); for(auto& t : todo) t(); diff --git a/pdns/dnsdist.hh b/pdns/dnsdist.hh index 7757e69288..eed5d46940 100644 --- a/pdns/dnsdist.hh +++ b/pdns/dnsdist.hh @@ -669,7 +669,7 @@ public: void addTCPClientThread(); }; -extern std::shared_ptr g_tcpclientthreads; +extern std::unique_ptr g_tcpclientthreads; struct DownstreamState {