diff --git a/changes-entries/reqtimeout-defaults.txt b/changes-entries/reqtimeout-defaults.txt new file mode 100644 index 00000000000..3e5b68928c9 --- /dev/null +++ b/changes-entries/reqtimeout-defaults.txt @@ -0,0 +1,2 @@ + *) Add add a default handshake timeout (10s) to mod_reqtimeouts internal + defaults and the the default configuration. [Eric Covener] diff --git a/docs/conf/extra/httpd-default.conf.in b/docs/conf/extra/httpd-default.conf.in index 7196922866a..042595b3513 100644 --- a/docs/conf/extra/httpd-default.conf.in +++ b/docs/conf/extra/httpd-default.conf.in @@ -86,5 +86,5 @@ HostnameLookups Off # To disable, set to header=0 body=0 # - RequestReadTimeout header=20-40,MinRate=500 body=20,MinRate=500 + RequestReadTimeout handshake=10,MinRate=250 header=20-40,MinRate=500 body=20,MinRate=500 diff --git a/docs/manual/mod/mod_reqtimeout.xml b/docs/manual/mod/mod_reqtimeout.xml index 7b4d3e6d112..863c72c76d5 100644 --- a/docs/manual/mod/mod_reqtimeout.xml +++ b/docs/manual/mod/mod_reqtimeout.xml @@ -103,11 +103,12 @@ the request headers and/or body from client. [header=timeout[-maxtimeout][,MinRate=rate] [body=timeout[-maxtimeout][,MinRate=rate] -RequestReadTimeout handshake=0 header=20-40,MinRate=500 body=20,MinRate=500 +RequestReadTimeout handshake=10,MinRate=250 header=20-40,MinRate=500 body=20,MinRate=500 server configvirtual host Defaulted to disabled in version 2.3.14 and earlier. The -handshake stage is available since version 2.4.39. +handshake stage is available since version 2.4.39, with non-zero +defaults added in 2.4.67. @@ -156,8 +157,11 @@ the request headers and/or body from client. handshake=0 header=0 body=0 -

This disables mod_reqtimeout completely (note that - handshake=0 is the default already and could be omitted).

+

This disables mod_reqtimeout completely. This may be + useful in virtual hosts used with alternate protocols where the stages + of this module do not map to the protocol and may not transition + past the handshake setting. +

  • Timeout value that is increased when data is diff --git a/modules/filters/mod_reqtimeout.c b/modules/filters/mod_reqtimeout.c index 0e5afca57e4..064d7d4a518 100644 --- a/modules/filters/mod_reqtimeout.c +++ b/modules/filters/mod_reqtimeout.c @@ -29,9 +29,9 @@ module AP_MODULE_DECLARE_DATA reqtimeout_module; #define UNSET -1 -#define MRT_DEFAULT_handshake_TIMEOUT 0 /* disabled */ +#define MRT_DEFAULT_handshake_TIMEOUT 10 #define MRT_DEFAULT_handshake_MAX_TIMEOUT 0 -#define MRT_DEFAULT_handshake_MIN_RATE 0 +#define MRT_DEFAULT_handshake_MIN_RATE 250 #define MRT_DEFAULT_header_TIMEOUT 20 #define MRT_DEFAULT_header_MAX_TIMEOUT 40 #define MRT_DEFAULT_header_MIN_RATE 500 @@ -375,8 +375,7 @@ static int reqtimeout_init(conn_rec *c) &reqtimeout_module); AP_DEBUG_ASSERT(cfg != NULL); - /* For compatibility, handshake timeout is disabled when UNSET (< 0) */ - if (cfg->handshake.timeout <= 0 + if (cfg->handshake.timeout == 0 && cfg->header.timeout == 0 && cfg->body.timeout == 0) { /* disabled for this vhost */ @@ -391,9 +390,7 @@ static int reqtimeout_init(conn_rec *c) ap_add_input_filter(reqtimeout_filter_name, ccfg, NULL, c); ccfg->type = "handshake"; - if (cfg->handshake.timeout > 0) { - INIT_STAGE(cfg, ccfg, handshake); - } + INIT_STAGE(cfg, ccfg, handshake); } /* we are not handling the connection, we just do initialization */