From: Takashi Sato Date: Mon, 12 Jan 2009 00:52:26 +0000 (+0000) Subject: Enhance KeepAliveTimeout to support a value in milliseconds. X-Git-Tag: 2.3.2~178 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5585fc8d5bce4cd60fea9f4c335af3ba1759e5e0;p=thirdparty%2Fapache%2Fhttpd.git Enhance KeepAliveTimeout to support a value in milliseconds. PR: 46275 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@733557 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index fb8b90fc463..7779067e9d5 100644 --- 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] diff --git a/docs/manual/mod/core.xml b/docs/manual/mod/core.xml index ecf75ac9865..7ea1ced2212 100644 --- a/docs/manual/mod/core.xml +++ b/docs/manual/mod/core.xml @@ -1558,14 +1558,17 @@ the server configuration files KeepAliveTimeout Amount of time the server will wait for subsequent requests on a persistent connection -KeepAliveTimeout seconds +KeepAliveTimeout num[ms] KeepAliveTimeout 5 server configvirtual host +Specifying a value in milliseconds is available in +Apache 2.3.2 and later

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 Timeout directive applies.

diff --git a/docs/manual/new_features_2_4.xml b/docs/manual/new_features_2_4.xml index 1d844c48345..7139ca42d39 100644 --- a/docs/manual/new_features_2_4.xml +++ b/docs/manual/new_features_2_4.xml @@ -33,8 +33,13 @@
Core Enhancements - +
+
KeepAliveTimeout in milliseconds
+ +
It has been made to be possible to specify KeepAliveTimeout in milliseconds. +
+
diff --git a/modules/http/http_core.c b/modules/http/http_core.c index fdf86c0644f..2108b869ad4 100644 --- a/modules/http/http_core.c +++ b/modules/http/http_core.c @@ -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; }