You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by yl...@apache.org on 2015/03/05 11:41:19 UTC
svn commit: r1664299 - in /httpd/httpd/trunk: include/httpd.h
modules/http/http_core.c
Author: ylavic
Date: Thu Mar 5 10:41:19 2015
New Revision: 1664299
URL: http://svn.apache.org/r1664299
Log:
core: Follow up to r1664077: comments on new keep_alive_timeout_set flag.
Modified:
httpd/httpd/trunk/include/httpd.h
httpd/httpd/trunk/modules/http/http_core.c
Modified: httpd/httpd/trunk/include/httpd.h
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/include/httpd.h?rev=1664299&r1=1664298&r2=1664299&view=diff
==============================================================================
--- httpd/httpd/trunk/include/httpd.h (original)
+++ httpd/httpd/trunk/include/httpd.h Thu Mar 5 10:41:19 2015
@@ -1338,8 +1338,9 @@ struct server_rec {
/** Opaque storage location */
void *context;
- /** Whether the keepalive timeout is explicit or inherited
- * from the default vhost or main server. */
+ /** Whether the keepalive timeout is explicit (1) or
+ * inherited (0) from the base server (either first
+ * server on the same IP:port or main server) */
unsigned int keep_alive_timeout_set:1;
};
Modified: httpd/httpd/trunk/modules/http/http_core.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/http/http_core.c?rev=1664299&r1=1664298&r2=1664299&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/http/http_core.c (original)
+++ httpd/httpd/trunk/modules/http/http_core.c Thu Mar 5 10:41:19 2015
@@ -61,6 +61,14 @@ static const char *set_keep_alive_timeou
if (ap_timeout_parameter_parse(arg, &timeout, "s") != APR_SUCCESS)
return "KeepAliveTimeout has wrong format";
cmd->server->keep_alive_timeout = timeout;
+
+ /* We don't want to take into account whether or not KeepAliveTimeout is
+ * set for the main server, because if no http_module directive is used
+ * for a vhost, it will inherit the http_srv_cfg from the main server.
+ * However keep_alive_timeout_set helps determine whether the vhost should
+ * use its own configured timeout or the one from the vhost delared first
+ * on the same IP:port (ie. c->base_server, and the legacy behaviour).
+ */
if (cmd->server->is_virtual) {
cmd->server->keep_alive_timeout_set = 1;
}