]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
mod_reqtimeout: Resolve unexpected timeouts on keepalive requests
authorEric Covener <covener@apache.org>
Sun, 23 Mar 2014 18:59:37 +0000 (18:59 +0000)
committerEric Covener <covener@apache.org>
Sun, 23 Mar 2014 18:59:37 +0000 (18:59 +0000)
under the Event MPM. PR56216.

Submitted By: Frank Meier <frank meier ergon ch>
Committed By: covener

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1580568 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
modules/filters/mod_reqtimeout.c

diff --git a/CHANGES b/CHANGES
index a2de33e4f3fde53cb38b46f53fa92806aa8267a1..fdce3eb36688d5235f069b970b0f6e86fb47cf6e 100644 (file)
--- 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 <frank meier ergon ch>]
+
   *) mod_lua: Add r:wspeek for checking if there is any data waiting on the line
      [Daniel Gruno]
 
index 3250efcadece1a6d141745f0ae84b653ace6e7b9..b19d9512503902ba859465b3093cfa76a4454c4d 100644 (file)
@@ -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;
 }