From: Stefan Fritsch Date: Tue, 10 Nov 2009 15:27:02 +0000 (+0000) Subject: Fix broken config check for *max timeouts X-Git-Tag: 2.3.3~6 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3ce0b4fbcde6dcd4d6cc2da5fc5617e3ea3c2d76;p=apache Fix broken config check for *max timeouts Fix floating point exception for *minrate == 0 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@834499 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/filters/mod_reqtimeout.c b/modules/filters/mod_reqtimeout.c index b8e1750d56..206c1aad04 100644 --- a/modules/filters/mod_reqtimeout.c +++ b/modules/filters/mod_reqtimeout.c @@ -305,7 +305,8 @@ static const char *set_reqtimeout_param(reqtimeout_srv_cfg *conf, } else if (!strcasecmp(key, "headermax")) { ret = parse_int(val, &conf->header_max_timeout); - if (!ret && conf->header_max_timeout > conf->header_timeout) { + if (!ret && conf->header_max_timeout > 0 && + conf->header_max_timeout <= conf->header_timeout) { ret = "Max timeout must be larger than initial timeout"; } } @@ -314,19 +315,20 @@ static const char *set_reqtimeout_param(reqtimeout_srv_cfg *conf, } else if (!strcasecmp(key, "bodymax")) { ret = parse_int(val, &conf->body_max_timeout); - if (!ret && conf->body_max_timeout > conf->body_timeout) { + if (!ret && conf->body_max_timeout > 0 && + conf->body_max_timeout <= conf->body_timeout) { ret = "Max timeout must be larger than initial timeout"; } } else if (!strcasecmp(key, "headerminrate")) { ret = parse_int(val, &conf->header_min_rate); - if (!ret) { + if (!ret && conf->header_min_rate > 0) { conf->header_rate_factor = apr_time_from_sec(1) / conf->header_min_rate; } } else if (!strcasecmp(key, "bodyminrate")) { ret = parse_int(val, &conf->body_min_rate); - if (!ret) { + if (!ret && conf->body_min_rate > 0) { conf->body_rate_factor = apr_time_from_sec(1) / conf->body_min_rate; } }