From 2aa2a913c3d28247cc9ca426c810975316775888 Mon Sep 17 00:00:00 2001 From: Giuseppe Scrivano Date: Sun, 21 Nov 2010 22:56:20 +0100 Subject: [PATCH] On a network error, attempt to resume the download, not restart it. --- src/ChangeLog | 7 +++++++ src/ftp.c | 4 ++-- src/http.c | 4 ++-- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 51abb4ce..7e560224 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +2010-11-21 Giuseppe Scrivano + + * ftp.c (getftp): If `count' is bigger than zero, try to resume the + download, not restart it. + * http.c (gethttp): Likewise. + Suggested by: Evgeny Kapun . + 2010-11-19 Giuseppe Scrivano * fttp.c (getftp): Accept new argument `count'. When `count' is diff --git a/src/ftp.c b/src/ftp.c index 8dddeed8..c331d066 100644 --- a/src/ftp.c +++ b/src/ftp.c @@ -1152,7 +1152,7 @@ Error in server response, closing control connection.\n")); # define BIN_TYPE_FILE 1 #endif /* def __VMS [else] */ - if (restval && !(con->cmd & DO_LIST)) + if ((restval && !(con->cmd & DO_LIST)) || count > 0) { #ifdef __VMS int open_id; @@ -1172,7 +1172,7 @@ Error in server response, closing control connection.\n")); #endif /* def __VMS [else] */ } else if (opt.noclobber || opt.always_rest || opt.timestamping || opt.dirstruct - || opt.output_document || count > 0) + || opt.output_document) { if (opt.unlink && file_exists_p (con->target)) { diff --git a/src/http.c b/src/http.c index a0e41cac..99f58b3f 100644 --- a/src/http.c +++ b/src/http.c @@ -2468,7 +2468,7 @@ File %s already there; not retrieving.\n\n"), quote (hs->local_file)); mkalldirs (hs->local_file); if (opt.backups) rotate_backups (hs->local_file); - if (hs->restval) + if (hs->restval || count > 0) { #ifdef __VMS int open_id; @@ -2479,7 +2479,7 @@ File %s already there; not retrieving.\n\n"), quote (hs->local_file)); fp = fopen (hs->local_file, "ab"); #endif /* def __VMS [else] */ } - else if (ALLOW_CLOBBER || count > 0) + else if (ALLOW_CLOBBER) { if (opt.unlink && file_exists_p (hs->local_file)) { -- 2.39.2