You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by co...@apache.org on 2014/03/23 19:59:37 UTC

svn commit: r1580568 - in /httpd/httpd/trunk: CHANGES modules/filters/mod_reqtimeout.c

Author: covener
Date: Sun Mar 23 18:59:37 2014
New Revision: 1580568

URL: http://svn.apache.org/r1580568
Log:
mod_reqtimeout: Resolve unexpected timeouts on keepalive requests 
under the Event MPM. PR56216.  

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



Modified:
    httpd/httpd/trunk/CHANGES
    httpd/httpd/trunk/modules/filters/mod_reqtimeout.c

Modified: httpd/httpd/trunk/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/CHANGES?rev=1580568&r1=1580567&r2=1580568&view=diff
==============================================================================
--- httpd/httpd/trunk/CHANGES [utf-8] (original)
+++ httpd/httpd/trunk/CHANGES [utf-8] Sun Mar 23 18:59:37 2014
@@ -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]
 

Modified: httpd/httpd/trunk/modules/filters/mod_reqtimeout.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/filters/mod_reqtimeout.c?rev=1580568&r1=1580567&r2=1580568&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/filters/mod_reqtimeout.c (original)
+++ httpd/httpd/trunk/modules/filters/mod_reqtimeout.c Sun Mar 23 18:59:37 2014
@@ -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;
 }