]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Only clean on store if over a limit
authorOtto <otto.moerbeek@open-xchange.com>
Tue, 24 Aug 2021 09:25:07 +0000 (11:25 +0200)
committerOtto <otto.moerbeek@open-xchange.com>
Fri, 24 Sep 2021 07:59:43 +0000 (09:59 +0200)
pdns/recursordist/rec-tcpout.cc

index 91a0ef822c3f5826e4aab4f9a152bf7665871116..5d05fb596e7222cdd1bcf93585fb6ba5765dbf83 100644 (file)
@@ -49,7 +49,10 @@ void TCPOutConnectionManager::cleanup()
 
 void TCPOutConnectionManager::store(const ComboAddress& ip, Connection& connection)
 {
-  cleanup();
+  if (d_idle_connections.size() >= maxIdlePerThread || d_idle_connections.count(ip) >= maxIdlePerAuth) {
+    cleanup();
+  }
+
   if (d_idle_connections.size() >= maxIdlePerThread) {
     return;
   }