httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yla...@apache.org
Subject svn commit: r1857129 - /httpd/httpd/trunk/modules/filters/mod_reqtimeout.c
Date Mon, 08 Apr 2019 18:46:12 GMT
Author: ylavic
Date: Mon Apr  8 18:46:12 2019
New Revision: 1857129

URL: http://svn.apache.org/viewvc?rev=1857129&view=rev
Log:
mod_reqtimeout: fix default_[stage]_rate_factor initializations.

r1853901 lowercased the [stage] for MRT_DEFAULT_[stage]_* macros but missed
to change the ones used in reqtimeout_hooks() to initialize the default rate
factors, leading to no default rate in 2.4.39. Fix that now. PR 63325.

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=1857129&r1=1857128&r2=1857129&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/filters/mod_reqtimeout.c (original)
+++ httpd/httpd/trunk/modules/filters/mod_reqtimeout.c Mon Apr  8 18:46:12 2019
@@ -31,7 +31,7 @@ module AP_MODULE_DECLARE_DATA reqtimeout
 #define UNSET                            -1
 #define MRT_DEFAULT_handshake_TIMEOUT     0 /* disabled */
 #define MRT_DEFAULT_handshake_MAX_TIMEOUT 0
-#define MRT_DEFAULT_handshake_MIN_RATE    APR_INT32_MAX
+#define MRT_DEFAULT_handshake_MIN_RATE    0
 #define MRT_DEFAULT_header_TIMEOUT       20
 #define MRT_DEFAULT_header_MAX_TIMEOUT   40
 #define MRT_DEFAULT_header_MIN_RATE      500
@@ -220,7 +220,7 @@ static apr_status_t reqtimeout_filter(ap
     if (block == APR_NONBLOCK_READ || mode == AP_MODE_INIT
         || mode == AP_MODE_EATCRLF) {
         rv = ap_get_brigade(f->next, bb, mode, block, readbytes);
-        if (ccfg->cur_stage.rate_factor > 0 && rv == APR_SUCCESS) {
+        if (ccfg->cur_stage.rate_factor && rv == APR_SUCCESS) {
             extend_timeout(ccfg, bb);
         }
         return rv;
@@ -254,7 +254,7 @@ static apr_status_t reqtimeout_filter(ap
             }
 
             if (!APR_BRIGADE_EMPTY(bb)) {
-                if (ccfg->cur_stage.rate_factor > 0) {
+                if (ccfg->cur_stage.rate_factor) {
                     extend_timeout(ccfg, bb);
                 }
 
@@ -315,7 +315,7 @@ static apr_status_t reqtimeout_filter(ap
          * the real (relevant) bytes to be asked later, within the
          * currently alloted time.
          */
-        if (ccfg->cur_stage.rate_factor > 0 && rv == APR_SUCCESS
+        if (ccfg->cur_stage.rate_factor && rv == APR_SUCCESS
                 && mode != AP_MODE_SPECULATIVE) {
             extend_timeout(ccfg, bb);
         }
@@ -638,17 +638,17 @@ static void reqtimeout_hooks(apr_pool_t
     ap_hook_post_read_request(reqtimeout_before_body, NULL, NULL,
                               APR_HOOK_MIDDLE);
 
-#if MRT_DEFAULT_HANDSHAKE_MIN_RATE > 0
+#if MRT_DEFAULT_handshake_MIN_RATE
     default_handshake_rate_factor = apr_time_from_sec(1) /
-                                    MRT_DEFAULT_HANDSHAKE_MIN_RATE;
+                                    MRT_DEFAULT_handshake_MIN_RATE;
 #endif
-#if MRT_DEFAULT_HEADER_MIN_RATE > 0
+#if MRT_DEFAULT_header_MIN_RATE
     default_header_rate_factor = apr_time_from_sec(1) /
-                                 MRT_DEFAULT_HEADER_MIN_RATE;
+                                 MRT_DEFAULT_header_MIN_RATE;
 #endif
-#if MRT_DEFAULT_BODY_MIN_RATE > 0
+#if MRT_DEFAULT_body_MIN_RATE
     default_body_rate_factor = apr_time_from_sec(1) /
-                               MRT_DEFAULT_BODY_MIN_RATE;
+                               MRT_DEFAULT_body_MIN_RATE;
 #endif
 }
 



Mime
View raw message