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

On a network error, attempt to resume the download, not restart it.

This commit is contained in:
Giuseppe Scrivano 2010-11-21 22:56:20 +01:00
parent 336f3c63d1
commit 2aa2a913c3
3 changed files with 11 additions and 4 deletions

View File

@ -1,3 +1,10 @@
2010-11-21 Giuseppe Scrivano <gscrivano@gnu.org>
* 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 <abacabadabacaba@gmail.com>.
2010-11-19 Giuseppe Scrivano <gscrivano@gnu.org> 2010-11-19 Giuseppe Scrivano <gscrivano@gnu.org>
* fttp.c (getftp): Accept new argument `count'. When `count' is * fttp.c (getftp): Accept new argument `count'. When `count' is

View File

@ -1152,7 +1152,7 @@ Error in server response, closing control connection.\n"));
# define BIN_TYPE_FILE 1 # define BIN_TYPE_FILE 1
#endif /* def __VMS [else] */ #endif /* def __VMS [else] */
if (restval && !(con->cmd & DO_LIST)) if ((restval && !(con->cmd & DO_LIST)) || count > 0)
{ {
#ifdef __VMS #ifdef __VMS
int open_id; int open_id;
@ -1172,7 +1172,7 @@ Error in server response, closing control connection.\n"));
#endif /* def __VMS [else] */ #endif /* def __VMS [else] */
} }
else if (opt.noclobber || opt.always_rest || opt.timestamping || opt.dirstruct 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)) if (opt.unlink && file_exists_p (con->target))
{ {

View File

@ -2468,7 +2468,7 @@ File %s already there; not retrieving.\n\n"), quote (hs->local_file));
mkalldirs (hs->local_file); mkalldirs (hs->local_file);
if (opt.backups) if (opt.backups)
rotate_backups (hs->local_file); rotate_backups (hs->local_file);
if (hs->restval) if (hs->restval || count > 0)
{ {
#ifdef __VMS #ifdef __VMS
int open_id; 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"); fp = fopen (hs->local_file, "ab");
#endif /* def __VMS [else] */ #endif /* def __VMS [else] */
} }
else if (ALLOW_CLOBBER || count > 0) else if (ALLOW_CLOBBER)
{ {
if (opt.unlink && file_exists_p (hs->local_file)) if (opt.unlink && file_exists_p (hs->local_file))
{ {