From 5d8cfbd9044f91d277027d8c1aab3c47e118b407 Mon Sep 17 00:00:00 2001 From: hniksic Date: Thu, 2 Mar 2000 06:45:37 -0800 Subject: [PATCH] [svn] Applied contributed patches (see ChangeLog for details.) --- src/ChangeLog | 4 ++++ src/ftp.c | 13 ++++++++++--- src/http.c | 28 ++++++++++++++++++---------- src/init.c | 3 ++- src/main.c | 14 ++++++++++++++ src/options.h | 3 ++- 6 files changed, 50 insertions(+), 15 deletions(-) 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 -- 2.39.2