From: bert hubert Date: Fri, 18 Apr 2014 05:37:40 +0000 (+0200) Subject: prevent duplicate logging of TCP overflows X-Git-Tag: rec-3.6.0-rc1~58 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5c889cf5921bac43bec8461b89dd463fb45b0d83;p=thirdparty%2Fpdns.git prevent duplicate logging of TCP overflows --- diff --git a/pdns/pdns_recursor.cc b/pdns/pdns_recursor.cc index 77fdf700fc..2bcbf62531 100644 --- a/pdns/pdns_recursor.cc +++ b/pdns/pdns_recursor.cc @@ -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; + } } } }