+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
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))
{
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;