Skip to content

Commit 537be18

Browse files
committed
meout: fix default_[stage]_rate_factor initializations.
PR: 238488 Reported by: girgen Sponsored by: Netzkommune GmbH
1 parent ef6d43b commit 537be18

2 files changed

Lines changed: 63 additions & 0 deletions

File tree

‎www/apache24/Makefile‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
PORTNAME= apache24
44
PORTVERSION= 2.4.39
5+
PORTREVISION= 1
56
CATEGORIES= www ipv6
67
MASTER_SITES= APACHE_HTTPD
78
DISTNAME= httpd-${PORTVERSION}
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
--- modules/filters/mod_reqtimeout.c 2019/04/08 18:30:57 1857128
2+
+++ modules/filters/mod_reqtimeout.c 2019/04/08 18:46:12 1857129
3+
@@ -31,7 +31,7 @@
4+
#define UNSET -1
5+
#define MRT_DEFAULT_handshake_TIMEOUT 0 /* disabled */
6+
#define MRT_DEFAULT_handshake_MAX_TIMEOUT 0
7+
-#define MRT_DEFAULT_handshake_MIN_RATE APR_INT32_MAX
8+
+#define MRT_DEFAULT_handshake_MIN_RATE 0
9+
#define MRT_DEFAULT_header_TIMEOUT 20
10+
#define MRT_DEFAULT_header_MAX_TIMEOUT 40
11+
#define MRT_DEFAULT_header_MIN_RATE 500
12+
@@ -220,7 +220,7 @@
13+
if (block == APR_NONBLOCK_READ || mode == AP_MODE_INIT
14+
|| mode == AP_MODE_EATCRLF) {
15+
rv = ap_get_brigade(f->next, bb, mode, block, readbytes);
16+
- if (ccfg->cur_stage.rate_factor > 0 && rv == APR_SUCCESS) {
17+
+ if (ccfg->cur_stage.rate_factor && rv == APR_SUCCESS) {
18+
extend_timeout(ccfg, bb);
19+
}
20+
return rv;
21+
@@ -254,7 +254,7 @@
22+
}
23+
24+
if (!APR_BRIGADE_EMPTY(bb)) {
25+
- if (ccfg->cur_stage.rate_factor > 0) {
26+
+ if (ccfg->cur_stage.rate_factor) {
27+
extend_timeout(ccfg, bb);
28+
}
29+
30+
@@ -315,7 +315,7 @@
31+
* the real (relevant) bytes to be asked later, within the
32+
* currently alloted time.
33+
*/
34+
- if (ccfg->cur_stage.rate_factor > 0 && rv == APR_SUCCESS
35+
+ if (ccfg->cur_stage.rate_factor && rv == APR_SUCCESS
36+
&& mode != AP_MODE_SPECULATIVE) {
37+
extend_timeout(ccfg, bb);
38+
}
39+
@@ -638,17 +638,17 @@
40+
ap_hook_post_read_request(reqtimeout_before_body, NULL, NULL,
41+
APR_HOOK_MIDDLE);
42+
43+
-#if MRT_DEFAULT_HANDSHAKE_MIN_RATE > 0
44+
+#if MRT_DEFAULT_handshake_MIN_RATE
45+
default_handshake_rate_factor = apr_time_from_sec(1) /
46+
- MRT_DEFAULT_HANDSHAKE_MIN_RATE;
47+
+ MRT_DEFAULT_handshake_MIN_RATE;
48+
#endif
49+
-#if MRT_DEFAULT_HEADER_MIN_RATE > 0
50+
+#if MRT_DEFAULT_header_MIN_RATE
51+
default_header_rate_factor = apr_time_from_sec(1) /
52+
- MRT_DEFAULT_HEADER_MIN_RATE;
53+
+ MRT_DEFAULT_header_MIN_RATE;
54+
#endif
55+
-#if MRT_DEFAULT_BODY_MIN_RATE > 0
56+
+#if MRT_DEFAULT_body_MIN_RATE
57+
default_body_rate_factor = apr_time_from_sec(1) /
58+
- MRT_DEFAULT_BODY_MIN_RATE;
59+
+ MRT_DEFAULT_body_MIN_RATE;
60+
#endif
61+
}
62+

0 commit comments

Comments
 (0)