]> granicus.if.org Git - apache/commitdiff
mod_reqtimeout: follow up to r1853901: init stage name outside INIT_STAGE().
authorYann Ylavic <ylavic@apache.org>
Wed, 20 Feb 2019 08:54:51 +0000 (08:54 +0000)
committerYann Ylavic <ylavic@apache.org>
Wed, 20 Feb 2019 08:54:51 +0000 (08:54 +0000)
It helps both code readability where stages are initilized and potential
logging in the input filter (even if the stage is disabled).

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

modules/filters/mod_reqtimeout.c

index e6e93e65d134148b570265866fd490c8ac0840a4..ce8950b87d0532826c2f2ebaa714d3cbcb2c3210 100644 (file)
@@ -365,7 +365,6 @@ static apr_status_t reqtimeout_eor(ap_filter_t *f, apr_bucket_brigade *bb)
         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(request_rec *r, conn_rec *c)
     /* (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(request_rec *r)
                                &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;