You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by yl...@apache.org on 2019/02/20 08:54:52 UTC

svn commit: r1853935 - /httpd/httpd/trunk/modules/filters/mod_reqtimeout.c

Author: ylavic
Date: Wed Feb 20 08:54:51 2019
New Revision: 1853935

URL: http://svn.apache.org/viewvc?rev=1853935&view=rev
Log:
mod_reqtimeout: follow up to r1853901: init stage name outside INIT_STAGE().

It helps both code readability where stages are initilized and potential
logging in the output filter (even if the stage is disabled).

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

Modified: httpd/httpd/trunk/modules/filters/mod_reqtimeout.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/filters/mod_reqtimeout.c?rev=1853935&r1=1853934&r2=1853935&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/filters/mod_reqtimeout.c (original)
+++ httpd/httpd/trunk/modules/filters/mod_reqtimeout.c Wed Feb 20 08:54:51 2019
@@ -365,7 +365,6 @@ static apr_status_t reqtimeout_eor(ap_fi
         ccfg->cur_stage.max_timeout = MRT_DEFAULT_##stage##_MAX_TIMEOUT; \
         ccfg->cur_stage.rate_factor = default_##stage##_rate_factor; \
     } \
-    ccfg->type = #stage; \
 } while (0)
 
 static int reqtimeout_init(conn_rec *c)
@@ -392,6 +391,7 @@ static int reqtimeout_init(conn_rec *c)
         ap_add_output_filter(reqtimeout_filter_name, ccfg, NULL, c);
         ap_add_input_filter(reqtimeout_filter_name, ccfg, NULL, c);
 
+        ccfg->type = "handshake";
         if (cfg->handshake.timeout > 0) {
             INIT_STAGE(cfg, ccfg, handshake);
         }
@@ -419,6 +419,7 @@ static void reqtimeout_before_header(req
     /* (Re)set the state for this new request, but ccfg->socket and
      * ccfg->tmpbb which have the lifetime of the connection.
      */
+    ccfg->type = "header";
     ccfg->timeout_at = 0;
     ccfg->max_timeout_at = 0;
     ccfg->in_keep_alive = (c->keepalives > 0);
@@ -439,9 +440,9 @@ static int reqtimeout_before_body(reques
                                &reqtimeout_module);
     AP_DEBUG_ASSERT(cfg != NULL);
 
+    ccfg->type = "body";
     ccfg->timeout_at = 0;
     ccfg->max_timeout_at = 0;
-    ccfg->type = "body";
     if (r->method_number == M_CONNECT) {
         /* disabled for a CONNECT request */
         ccfg->cur_stage.timeout = 0;