Browse Source

[357] address review comments

- explain 0 value for tcp_recv_timeout
- initialize value in config parser (to 0, it will be set by build() anyway)
Jelte Jansen 12 years ago
parent
commit
6c9732dc5b
3 changed files with 8 additions and 2 deletions
  1. 1 0
      doc/guide/bind10-guide.xml
  2. 6 2
      src/bin/auth/auth_config.cc
  3. 1 0
      src/bin/auth/b10-auth.xml

+ 1 - 0
doc/guide/bind10-guide.xml

@@ -1640,6 +1640,7 @@ can use various data source backends.
                 <varname>tcp_recv_timeout</varname> is the timeout used on
                 incoming TCP connections, in milliseconds. If the query
                 is not sent within this time, the connection is closed.
+                Setting this to 0 will disable TCP timeouts completely.
               </simpara>
             </listitem>
           </varlistentry>

+ 6 - 2
src/bin/auth/auth_config.cc

@@ -120,11 +120,15 @@ private:
 /// \brief Configuration for TCP receive timeouts
 class TCPRecvTimeoutConfig : public AuthConfigParser {
 public:
-    TCPRecvTimeoutConfig(AuthSrv& server) : server_(server)
+    TCPRecvTimeoutConfig(AuthSrv& server) : server_(server), timeout_(0)
     {}
 
     virtual void build(ConstElementPtr config) {
-        timeout_ = config->intValue();
+        if (config->intValue() >= 0) {
+            timeout_ = config->intValue();
+        } else {
+            isc_throw(AuthConfigError, "tcp_recv_timeout must be 0 or higher");
+        }
     }
 
     virtual void commit() {

+ 1 - 0
src/bin/auth/b10-auth.xml

@@ -156,6 +156,7 @@
       <varname>tcp_recv_timeout</varname> is the timeout used on
       incoming TCP connections, in milliseconds. If the query
       is not sent within this time, the connection is closed.
+      Setting this to 0 will disable TCP timeouts completely.
     </para>
 
 <!-- TODO: formating -->