]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
prevent duplicate logging of TCP overflows
authorbert hubert <bert.hubert@netherlabs.nl>
Fri, 18 Apr 2014 05:37:40 +0000 (07:37 +0200)
committerbert hubert <bert.hubert@netherlabs.nl>
Fri, 18 Apr 2014 05:37:40 +0000 (07:37 +0200)
pdns/pdns_recursor.cc

index 77fdf700fc67077bbf5179d99627c1557413aced..2bcbf625314a3d7a0b8430b5ef0f943ed1502d20 100644 (file)
@@ -2031,18 +2031,20 @@ try
     t_fdm->run(&g_now);
     // 'run' updates g_now for us
 
-    if(listenOnTCP) {
-      if(TCPConnection::getCurrentConnections() > maxTcpClients) {  // shutdown, too many connections
-        for(tcpListenSockets_t::iterator i=g_tcpListenSockets.begin(); i != g_tcpListenSockets.end(); ++i)
-          t_fdm->removeReadFD(*i);
-        listenOnTCP=false;
+    if(!t_id) {
+      if(listenOnTCP) {
+       if(TCPConnection::getCurrentConnections() > maxTcpClients) {  // shutdown, too many connections
+         for(tcpListenSockets_t::iterator i=g_tcpListenSockets.begin(); i != g_tcpListenSockets.end(); ++i)
+           t_fdm->removeReadFD(*i);
+         listenOnTCP=false;
+       }
       }
-    }
-    else {
-      if(TCPConnection::getCurrentConnections() <= maxTcpClients) {  // reenable
-        for(tcpListenSockets_t::iterator i=g_tcpListenSockets.begin(); i != g_tcpListenSockets.end(); ++i)
-          t_fdm->addReadFD(*i, handleNewTCPQuestion);
-        listenOnTCP=true;
+      else {
+       if(TCPConnection::getCurrentConnections() <= maxTcpClients) {  // reenable
+         for(tcpListenSockets_t::iterator i=g_tcpListenSockets.begin(); i != g_tcpListenSockets.end(); ++i)
+           t_fdm->addReadFD(*i, handleNewTCPQuestion);
+         listenOnTCP=true;
+       }
       }
     }
   }