curl-users
Re: Auto resume bug in lib/ftp.c
Date: Thu, 10 Jul 2008 11:15:25 -0500
On Thursday 10 July 2008 1:11:23 am Dan Fandrich wrote:
> On Wed, Jul 09, 2008 at 09:48:14PM -0500, Adrian Kreher wrote:
> > I believe I have found a bug in lib/ftp.c. Using the -C switch with - to
> > have curl automatically detect the size is supposed to work if the server
> > supports SIZE. I don't really know C, so my understanding is somewhat
> > limited. From what I understand, src/main.c sets resume_from to 0 if it
> > is supposed to automatically detect the size. However, lib/ftp.c checks
> > to see if the value is less than to 0 (but not equal to). lib/http.c and
> > lib/ssh.c both check if this value is also equal to 0, so they should
> > handle this correctly, but I did not check.
> >
> > Using "-C -1" instead of "-C -" is a workaround for the time being.
>
> You haven't actually reported the symptoms of the bug. What doesn't seem
> to work? And which version of curl are you using?
Resuming during an upload was not even attempted (that is, the SIZE command
was not even being sent) on Win32 uploading to a FTPS (FTP over SSL) or
regular FTP server. The server was FileZilla, and it supports resume. I used
both 7.17.1 and the latest 7.18.2 to verify this.
> Oddly enough, the test suite wasn't testing resumed ftp downloads with -C -
> so I just added tests 1036 and 1037 to do so and they both work fine.
> Under what conditions does this bug manifest itself?
curl failed to send a SIZE command when uploading a file to an FTP server
using -C - and started to overwrite the file from the beginning instead.
Thanks,
-- Adrian Kreher ------------------------------------------------------------------- List admin: http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-users FAQ: http://curl.haxx.se/docs/faq.html Etiquette: http://curl.haxx.se/mail/etiquette.htmlReceived on 2008-07-10