On 17 Aug 2001, at 11:41, Dave Turner wrote:

> On Fri, 17 Aug 2001, Dave Turner wrote:
> 
> > By way of a hack I have used the SIZE command, not supported by RFC959 but
> > still accepted by many of the servers I use, to get the size of the file.
> > If that fails then it falls back on the old method.  The patch is
> > attached, in what I hope is an acceptable format.
> 
> Guess who forgot the attachment?  Sorry!

Nice patch. I think it can be improved by only sending the SIZE command 
if the file already exists (has a non-zero size, i.e. restval parameter 
in function getftp is non-zero).

I have attached a slightly modified version of Dave Turner 
<[EMAIL PROTECTED]>' s patch to add the non-zero restval test, 
remove an unused variable 's' from function ftp_size, and I have 
created the patch using the command cvs diff -uR to make it relative to 
the current CVS sources for wget-1.7.1-pre1.

Here is a ChangeLog entry for it:

2001-08-21  Dave Turner <[EMAIL PROTECTED]>

        * ftp-basic.c (ftp_size): New function to send non-standard SIZE
          command to server to request file size.
        * ftp.h (ftp_size): Export it.
        * ftp.c (getftp): Use new ftp_size function if restoring
          transfer of a file with unknown size.


wget-1.7.1-pre1-size-fix.patch

Reply via email to