]> granicus.if.org Git - pdns/commitdiff
hook up tcp timeout var again
authorBert Hubert <bert.hubert@netherlabs.nl>
Sun, 16 Apr 2006 23:17:45 +0000 (23:17 +0000)
committerBert Hubert <bert.hubert@netherlabs.nl>
Sun, 16 Apr 2006 23:17:45 +0000 (23:17 +0000)
git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@716 d19b8d6e-7fed-0310-83ef-9ca221ded41b

pdns/pdns_recursor.cc

index ed5be9906c48b8a788860625d77e029065823eca..0eca01d2a21afdc81430911cd9a89841bae89cba 100644 (file)
@@ -72,6 +72,7 @@ bool g_quiet;
 NetmaskGroup* g_allowFrom;
 string s_programname="pdns_recursor";
 int g_tcpListenSocket;
+int g_tcpTimeout;
 
 struct DNSComboWriter {
   DNSComboWriter(const char* data, uint16_t len, const struct timeval& now) : d_mdp(data, len), d_now(now), d_tcp(false), d_socket(-1)
@@ -719,7 +720,7 @@ void handleNewTCPQuestion(int fd, boost::any& )
     g_fdm->addReadFD(tc.fd, handleRunningTCPQuestion, tc);
     struct timeval now;
     gettimeofday(&now, 0);
-    g_fdm->setReadTTD(tc.fd, now, 2);
+    g_fdm->setReadTTD(tc.fd, now, g_tcpTimeout);
   }
 }
 
@@ -1306,7 +1307,7 @@ int main(int argc, char **argv)
 
     counter=0;
     unsigned int maxTcpClients=::arg().asNum("max-tcp-clients");
-    int tcpTimeout=::arg().asNum("client-tcp-timeout");
+    g_tcpTimeout=::arg().asNum("client-tcp-timeout");
 
     g_maxTCPPerClient=::arg().asNum("max-tcp-per-client");