From: Eric Covener Date: Sun, 23 Mar 2014 18:59:37 +0000 (+0000) Subject: mod_reqtimeout: Resolve unexpected timeouts on keepalive requests X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=05d5264cd3613562238e3e762721c125f3051c44;p=thirdparty%2Fapache%2Fhttpd.git mod_reqtimeout: Resolve unexpected timeouts on keepalive requests under the Event MPM. PR56216. Submitted By: Frank Meier Committed By: covener git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1580568 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index a2de33e4f3f..fdce3eb3668 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,9 @@ -*- coding: utf-8 -*- Changes with Apache 2.5.0 + *) mod_reqtimeout: Resolve unexpected timeouts on keepalive requests + under the Event MPM. PR56216. [Frank Meier ] + *) mod_lua: Add r:wspeek for checking if there is any data waiting on the line [Daniel Gruno] diff --git a/modules/filters/mod_reqtimeout.c b/modules/filters/mod_reqtimeout.c index 3250efcadec..b19d9512503 100644 --- a/modules/filters/mod_reqtimeout.c +++ b/modules/filters/mod_reqtimeout.c @@ -343,7 +343,17 @@ static int reqtimeout_init(conn_rec *c) return DECLINED; } - ccfg = apr_pcalloc(c->pool, sizeof(reqtimeout_con_cfg)); + ccfg = ap_get_module_config(c->conn_config, &reqtimeout_module); + if (ccfg == NULL) { + ccfg = apr_pcalloc(c->pool, sizeof(reqtimeout_con_cfg)); + ap_set_module_config(c->conn_config, &reqtimeout_module, ccfg); + ap_add_input_filter(reqtimeout_filter_name, ccfg, NULL, c); + } + else { + /* subsequent request under event-like MPM */ + memset(ccfg, 0, sizeof(reqtimeout_con_cfg)); + } + ccfg->type = "header"; if (cfg->header_timeout != UNSET) { ccfg->new_timeout = cfg->header_timeout; @@ -357,9 +367,7 @@ static int reqtimeout_init(conn_rec *c) ccfg->min_rate = MRT_DEFAULT_HEADER_MIN_RATE; ccfg->rate_factor = default_header_rate_factor; } - ap_set_module_config(c->conn_config, &reqtimeout_module, ccfg); - ap_add_input_filter("reqtimeout", ccfg, NULL, c); /* we are not handling the connection, we just do initialization */ return DECLINED; }