Package: pdns
Version: 2.9.21.2-1
Severity: wishlist
Tags: patch

Hi pdns maintainers,

the attached dpatch

## DP: Trivial two-line patch; allows tcp-idle-timeout in requests to
## DP: be configurable via command line argument.
## DP: TODO: Add tcp-idle-timout to usage help.

is used here (UI) to improve pdns. It applies cleanly to 2.9.21.2-1
after the existing dpatches.

We would be enlightened if you could review it and eventually consider
adding it to the Debian package.

Thanks!

Stephan

-- System Information:
Debian Release: 5.0
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.26-1-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
#! /bin/sh /usr/share/dpatch/dpatch-run
## ui-tcp-idle-timeout.dpatch by Stephan Suerken <stephan.suer...@1und1.de>
##
## All lines beginning with `## DP:' are a description of the patch.
##
## DP: Trivial two-line patch; allows tcp-idle-timeout in requests to
## DP: be configurable via command line argument.
## DP: TODO: Add tcp-idle-timout to usage help.

@DPATCH@
diff -urNad trunk~/pdns/common_startup.cc trunk/pdns/common_startup.cc
--- trunk~/pdns/common_startup.cc	2009-01-05 13:13:03.000000000 +0000
+++ trunk/pdns/common_startup.cc	2009-01-05 13:13:03.000000000 +0000
@@ -112,6 +112,7 @@
 
   arg().set("default-ttl","Seconds a result is valid if not set otherwise")="3600";
   arg().set("max-tcp-connections","Maximum number of TCP connections")="10";
+  arg().set("tcp-idle-timeout","Number of seconds a TCP client can be idle during a request")="10";
   arg().setSwitch("no-shuffle","Set this to prevent random shuffling of answers - for regression testing")="off";
 
   arg().setSwitch( "use-logfile", "Use a log file" )= "no";
diff -urNad trunk~/pdns/pdns.conf-dist trunk/pdns/pdns.conf-dist
--- trunk~/pdns/pdns.conf-dist	2007-04-21 13:56:36.000000000 +0000
+++ trunk/pdns/pdns.conf-dist	2009-01-05 13:13:03.000000000 +0000
@@ -155,6 +155,11 @@
 # max-tcp-connections=10
 
 #################################
+# tcp-idle-timeout	Number of seconds a TCP client can be idle during a request
+#
+# tcp-idle-timeout=10
+
+#################################
 # module-dir	Default directory for modules
 #
 # module-dir=/usr/local/lib
diff -urNad trunk~/pdns/tcpreceiver.cc trunk/pdns/tcpreceiver.cc
--- trunk~/pdns/tcpreceiver.cc	2007-04-21 13:56:36.000000000 +0000
+++ trunk/pdns/tcpreceiver.cc	2009-01-05 13:13:03.000000000 +0000
@@ -485,7 +485,7 @@
 //  sem_init(&d_connectionroom_sem,0,arg().asNum("max-tcp-connections"));
   d_connectionroom_sem = new Semaphore( arg().asNum( "max-tcp-connections" ));
 
-  s_timeout=10;
+  s_timeout=arg().asNum("tcp-idle-timeout");
   vector<string>locals;
   stringtok(locals,arg()["local-address"]," ,");
 

Reply via email to