mirror of
https://github.com/moparisthebest/wget
synced 2024-07-03 16:38:41 -04:00
Fix symlinks resume via FTP.
This commit is contained in:
parent
57584fe2da
commit
29c0b3cc07
@ -1,3 +1,9 @@
|
||||
2010-07-20 Leonid Petrov <nouser@lpetrov.net>
|
||||
|
||||
* ftp.c (getftp): Don't attempt to retrieve the file if it is already
|
||||
completely.
|
||||
(ftp_loop_internal): Force the length to be zero for symlinks.
|
||||
|
||||
2010-07-18 Giuseppe Scrivano <gscrivano@gnu.org>
|
||||
|
||||
* http.c (gethttp): If -N is used, don't exit immediately if the content
|
||||
|
12
src/ftp.c
12
src/ftp.c
@ -767,6 +767,16 @@ Error in server response, closing control connection.\n"));
|
||||
number_to_static_string (expected_bytes));
|
||||
}
|
||||
|
||||
if (cmd & DO_RETR && restval > 0 && restval == expected_bytes)
|
||||
{
|
||||
/* Server confirms that file has length restval. We should stop now.
|
||||
Some servers (f.e. NcFTPd) return error when receive REST 0 */
|
||||
logputs (LOG_VERBOSE, _("File has already been retrieved.\n"));
|
||||
fd_close (csock);
|
||||
con->csock = -1;
|
||||
return RETRFINISHED;
|
||||
}
|
||||
|
||||
/* If anything is to be retrieved, PORT (or PASV) must be sent. */
|
||||
if (cmd & (DO_LIST | DO_RETR))
|
||||
{
|
||||
@ -1459,7 +1469,7 @@ ftp_loop_internal (struct url *u, struct fileinfo *f, ccon *con, char **local_fi
|
||||
xfree (hurl);
|
||||
}
|
||||
/* Send getftp the proper length, if fileinfo was provided. */
|
||||
if (f)
|
||||
if (f && f->type != FT_SYMLINK)
|
||||
len = f->size;
|
||||
else
|
||||
len = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user