From 575f6bef608a3aac3145f4a9a642a7f70ec3e330 Mon Sep 17 00:00:00 2001 From: Eric Covener Date: Sun, 23 Mar 2014 18:59:37 +0000 Subject: [PATCH] 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 --- CHANGES | 3 +++ modules/filters/mod_reqtimeout.c | 14 +++++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index a2de33e4f3..fdce3eb366 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 3250efcade..b19d951250 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; } -- 2.40.0