1
0
mirror of https://github.com/moparisthebest/wget synced 2024-07-03 16:38:41 -04:00

[svn] Simplify indentation in sleep_between_retrievals.

This commit is contained in:
hniksic 2001-12-17 07:00:25 -08:00
parent 75699d6213
commit eb0f9de05d
2 changed files with 36 additions and 29 deletions

View File

@ -1,3 +1,7 @@
2001-12-17 Hrvoje Niksic <hniksic@arsdigita.com>
* retr.c (sleep_between_retrievals): Simplify indentation.
2001-12-17 Hrvoje Niksic <hniksic@arsdigita.com> 2001-12-17 Hrvoje Niksic <hniksic@arsdigita.com>
* gen_sslfunc.c (ssl_init_prng): Use random_number to get a byte * gen_sslfunc.c (ssl_init_prng): Use random_number to get a byte

View File

@ -653,13 +653,17 @@ sleep_between_retrievals (int count)
{ {
static int first_retrieval = 1; static int first_retrieval = 1;
if (!first_retrieval && (opt.wait || opt.waitretry)) if (first_retrieval)
{ {
/* Don't sleep before the very first retrieval. */
first_retrieval = 0;
return;
}
if (opt.waitretry && count > 1) if (opt.waitretry && count > 1)
{ {
/* If opt.waitretry is specified and this is a retry, wait /* If opt.waitretry is specified and this is a retry, wait for
for COUNT-1 number of seconds, or for opt.waitretry COUNT-1 number of seconds, or for opt.waitretry seconds. */
seconds. */
if (count <= opt.waitretry) if (count <= opt.waitretry)
sleep (count - 1); sleep (count - 1);
else else
@ -667,8 +671,10 @@ sleep_between_retrievals (int count)
} }
else if (opt.wait) else if (opt.wait)
{ {
/* Otherwise, check if opt.wait is specified. If so, sleep. */ if (!opt.random_wait || count > 1)
if (count > 1 || !opt.random_wait) /* If random-wait is not specified, or if we are sleeping
between retries of the same download, sleep the fixed
interval. */
sleep (opt.wait); sleep (opt.wait);
else else
{ {
@ -684,7 +690,4 @@ sleep_between_retrievals (int count)
sleep (waitsecs); sleep (waitsecs);
} }
} }
}
if (first_retrieval)
first_retrieval = 0;
} }