From: hniksic Date: Sun, 5 Feb 2006 08:35:22 +0000 (-0800) Subject: [svn] Made [0.5*wait, 1.5*wait) the range of --random-wait. X-Git-Tag: v1.13~685 X-Git-Url: http://sjero.net/git/?p=wget;a=commitdiff_plain;h=a20241837402cef880b2d07467c669d6ea00b8a0 [svn] Made [0.5*wait, 1.5*wait) the range of --random-wait. --- diff --git a/doc/ChangeLog b/doc/ChangeLog index bb68fdc8..ba602972 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,8 @@ +2006-02-05 Hrvoje Niksic + + * wget.texi (Download Options): Document the modified meaning of + --random-wait. + 2005-11-15 Hrvoje Niksic * wget.texi: Document https_proxy. diff --git a/doc/wget.texi b/doc/wget.texi index baa76c12..af63839f 100644 --- a/doc/wget.texi +++ b/doc/wget.texi @@ -789,7 +789,9 @@ suffix, or in days using @code{d} suffix. Specifying a large value for this option is useful if the network or the destination host is down, so that Wget can wait long enough to -reasonably expect the network error to be fixed before the retry. +reasonably expect the network error to be fixed before the retry. The +waiting interval specified by this function is influenced by +@code{--random-wait}, which see. @cindex retries, waiting between @cindex waiting between retries @@ -811,7 +813,7 @@ Note that this option is turned on by default in the global Some web sites may perform log analysis to identify retrieval programs such as Wget by looking for statistically significant similarities in the time between requests. This option causes the time between requests -to vary between 0 and 2 * @var{wait} seconds, where @var{wait} was +to vary between 0.5 and 1.5 * @var{wait} seconds, where @var{wait} was specified using the @samp{--wait} option, in order to mask Wget's presence from such analysis. diff --git a/src/ChangeLog b/src/ChangeLog index dbe41e32..14d91354 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2006-02-05 Hrvoje Niksic + + * retr.c (sleep_between_retrievals): Sleep at a minimum of 1/2 of + the specified wait period. + 2006-02-03 Hrvoje Niksic * utils.c (number_to_string): Don't use sprintf for printing diff --git a/src/retr.c b/src/retr.c index 1df7f3bf..14f4ffab 100644 --- a/src/retr.c +++ b/src/retr.c @@ -915,9 +915,9 @@ sleep_between_retrievals (int count) else { /* Sleep a random amount of time averaging in opt.wait - seconds. The sleeping amount ranges from 0 to - opt.wait*2, inclusive. */ - double waitsecs = 2 * opt.wait * random_float (); + seconds. The sleeping amount ranges from 0.5*opt.wait to + 1.5*opt.wait. */ + double waitsecs = (0.5 + random_float ()) * opt.wait; DEBUGP (("sleep_between_retrievals: avg=%f,sleep=%f\n", opt.wait, waitsecs)); xsleep (waitsecs);