From: Yann Ylavic Date: Thu, 5 Mar 2015 10:41:19 +0000 (+0000) Subject: core: Follow up to r1664077: comments on new keep_alive_timeout_set flag. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4405e62bb55a85c3c362e90825a781033f47913b;p=thirdparty%2Fapache%2Fhttpd.git core: Follow up to r1664077: comments on new keep_alive_timeout_set flag. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1664299 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/include/httpd.h b/include/httpd.h index 7776b7c792a..e6cf10fe80f 100644 --- a/include/httpd.h +++ b/include/httpd.h @@ -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; }; diff --git a/modules/http/http_core.c b/modules/http/http_core.c index 0c8662f4373..345de8109ae 100644 --- a/modules/http/http_core.c +++ b/modules/http/http_core.c @@ -61,6 +61,14 @@ static const char *set_keep_alive_timeout(cmd_parms *cmd, void *dummy, 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; }