diff options
author | Michael Drake <michael.drake@codethink.co.uk> | 2016-02-15 11:06:37 +0000 |
---|---|---|
committer | Michael Drake <michael.drake@codethink.co.uk> | 2016-02-15 11:06:37 +0000 |
commit | d39531ff554b19fefaeb9e3e08865fba1485b311 (patch) | |
tree | 9f10c25bb6b40430f4e04f698a1897aa8cd978fa /utils | |
parent | 6b57c94012201c974693dcd7fe53a070f8fc66e2 (diff) | |
download | netsurf-d39531ff554b19fefaeb9e3e08865fba1485b311.tar.gz netsurf-d39531ff554b19fefaeb9e3e08865fba1485b311.tar.bz2 |
Ensure fetch attempts is not reduced to less than 1.
Diffstat (limited to 'utils')
-rw-r--r-- | utils/nsoption.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/utils/nsoption.c b/utils/nsoption.c index b23bd8764..387d7c704 100644 --- a/utils/nsoption.c +++ b/utils/nsoption.c @@ -192,8 +192,9 @@ static void nsoption_validate(struct nsoption_s *opts, struct nsoption_s *defs) opts[NSOPTION_curl_fetch_timeout].value.u = 5; if (opts[NSOPTION_curl_fetch_timeout].value.u > 60) opts[NSOPTION_curl_fetch_timeout].value.u = 60; - while ((opts[NSOPTION_curl_fetch_timeout].value.u * - opts[NSOPTION_max_retried_fetches].value.u) > 60) + while (((opts[NSOPTION_curl_fetch_timeout].value.u * + opts[NSOPTION_max_retried_fetches].value.u) > 60) && + (opts[NSOPTION_max_retried_fetches].value.u > 1)) opts[NSOPTION_max_retried_fetches].value.u--; } |