From: hniksic Date: Thu, 2 Mar 2000 14:45:37 +0000 (-0800) Subject: [svn] Applied contributed patches (see ChangeLog for details.) X-Git-Tag: v1.13~2509 X-Git-Url: http://sjero.net/git/?p=wget;a=commitdiff_plain;h=5d8cfbd9044f91d277027d8c1aab3c47e118b407 [svn] Applied contributed patches (see ChangeLog for details.) --- diff --git a/src/ChangeLog b/src/ChangeLog index e60b55bc..07d3808a 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +1999-08-25 Heiko Herold + + * ftp.c: Respect new option waitretry. + 2000-01-30 Damir Dzeko * http.c (gethttp): Send custom Referer, if required. diff --git a/src/ftp.c b/src/ftp.c index 9077c674..e5a2925e 100644 --- a/src/ftp.c +++ b/src/ftp.c @@ -852,9 +852,16 @@ ftp_loop_internal (struct urlinfo *u, struct fileinfo *f, ccon *con) /* Increment the pass counter. */ ++count; /* Wait before the retrieval (unless this is the very first - retrieval). */ - if (!first_retrieval && opt.wait) - sleep (opt.wait); + retrieval). + Check if we are retrying or not, wait accordingly - HEH */ + if (!first_retrieval && (opt.wait || (count && opt.waitretry))) + if (count) + if (countst & ON_YOUR_OWN) diff --git a/src/http.c b/src/http.c index 8373133b..3403648a 100644 --- a/src/http.c +++ b/src/http.c @@ -488,13 +488,14 @@ User-Agent: %s\r\n\ Host: %s%s\r\n\ Accept: %s\r\n\ %s%s%s%s%s%s\r\n", - command, path, qstring, useragent, remhost, host_port ? host_port : "", - HTTP_ACCEPT, referer ? referer : "", - wwwauth ? wwwauth : "", - proxyauth ? proxyauth : "", - range ? range : "", - pragma_h, - opt.user_header ? opt.user_header : ""); + command, path, qstring ? qstring : "", useragent, remhost, + host_port ? host_port : "", + HTTP_ACCEPT, referer ? referer : "", + wwwauth ? wwwauth : "", + proxyauth ? proxyauth : "", + range ? range : "", + pragma_h, + opt.user_header ? opt.user_header : ""); DEBUGP (("---request begin---\n%s---request end---\n", request)); /* Free the temporary memory. */ FREE_MAYBE (wwwauth); @@ -957,9 +958,16 @@ File `%s' already there, will not retrieve.\n"), u->local); /* Increment the pass counter. */ ++count; /* Wait before the retrieval (unless this is the very first - retrieval). */ - if (!first_retrieval && opt.wait) - sleep (opt.wait); + retrieval). + Check if we are retrying or not, wait accordingly - HEH */ + if (!first_retrieval && (opt.wait || (count && opt.waitretry))) + if (count) + if (count0 and waitretry to 0 - HEH */ + if (opt.wait && !wr) + setval ("waitretry", opt.wait); + /* Sanity checks. */ if (opt.verbose && opt.quiet) { diff --git a/src/options.h b/src/options.h index b43bf7b3..1036c6f2 100644 --- a/src/options.h +++ b/src/options.h @@ -95,7 +95,8 @@ struct options long timeout; /* The value of read timeout in seconds. */ #endif - long wait; /* The wait period between retries. */ + long wait; /* The wait period between retrievals. */ + long waitretry; /* The wait period between retries. - HEH */ int use_robots; /* Do we heed robots.txt? */ long quota; /* Maximum number of bytes to