]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Enhance KeepAliveTimeout to support a value in milliseconds.
authorTakashi Sato <takashi@apache.org>
Mon, 12 Jan 2009 00:52:26 +0000 (00:52 +0000)
committerTakashi Sato <takashi@apache.org>
Mon, 12 Jan 2009 00:52:26 +0000 (00:52 +0000)
PR: 46275

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@733557 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
docs/manual/mod/core.xml
docs/manual/new_features_2_4.xml
modules/http/http_core.c

diff --git a/CHANGES b/CHANGES
index fb8b90fc463d1de233d5cdc91539267e0be1df67..7779067e9d5a4fc1cd40a338eb8c58ca36cc2f8d 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,9 @@
 Changes with Apache 2.3.2
 [ When backported to 2.2.x, remove entry from this file ]
 
+ *) core: Enhance KeepAliveTimeout to support a value in milliseconds.
+    PR 46275. [Takashi Sato]
+
  *) rotatelogs: Allow size units B, K, M, G and combination of
     time and size based rotation. [Rainer Jung]
 
index ecf75ac986546fb40ce25f651402a7358052eabe..7ea1ced2212026264d69577dc06ee58fb7e46fa2 100644 (file)
@@ -1558,14 +1558,17 @@ the server configuration files</description>
 <name>KeepAliveTimeout</name>
 <description>Amount of time the server will wait for subsequent
 requests on a persistent connection</description>
-<syntax>KeepAliveTimeout <var>seconds</var></syntax>
+<syntax>KeepAliveTimeout <var>num</var>[ms]</syntax>
 <default>KeepAliveTimeout 5</default>
 <contextlist><context>server config</context><context>virtual host</context>
 </contextlist>
+<compatibility>Specifying a value in milliseconds is available in 
+Apache 2.3.2 and later</compatibility>
 
 <usage>
     <p>The number of seconds Apache will wait for a subsequent
-    request before closing the connection. Once a request has been
+    request before closing the connection. By adding a postfix of ms the
+    timeout can be also set in milliseconds. Once a request has been
     received, the timeout value specified by the
     <directive module="core">Timeout</directive> directive applies.</p>
 
index 1d844c483456f96c2395aa1d4d24b509c18e9b42..7139ca42d39b8fddeb00d7228eeb51911e350d1f 100644 (file)
 
   <section id="core">
     <title>Core Enhancements</title>
-    <!-- <dl>
-    </dl> -->
+    <dl>
+      <dt>KeepAliveTimeout in milliseconds</dt>
+
+      <dd>It has been made to be possible to specify <directive module="core"
+      >KeepAliveTimeout</directive> in milliseconds.
+      </dd>
+    </dl>
   </section>
 
   <section id="module">
index fdf86c0644f4d739e7e8934d1ea0531b1c790e4e..2108b869ad44c24c9e89948886ce92e3a29e0147 100644 (file)
@@ -47,12 +47,16 @@ static int ap_process_http_connection(conn_rec *c);
 static const char *set_keep_alive_timeout(cmd_parms *cmd, void *dummy,
                                           const char *arg)
 {
+    apr_interval_time_t timeout;
     const char *err = ap_check_cmd_context(cmd, NOT_IN_DIR_LOC_FILE);
     if (err != NULL) {
         return err;
     }
 
-    cmd->server->keep_alive_timeout = apr_time_from_sec(atoi(arg));
+    /* Stolen from mod_proxy.c */
+    if (ap_timeout_parameter_parse(arg, &timeout, "s") != APR_SUCCESS)
+        return "KeepAliveTimeout has wrong format";
+    cmd->server->keep_alive_timeout = timeout;
     return NULL;
 }