cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Handling broken ftp REST over 2 GB

From: Dave Meyer <meyer_at_paracel.com>
Date: Tue, 16 Dec 2003 10:00:18 -0800 (PST)

> > Then it would be a pretty simple thing to see if it matched our request or
> > not. Although I have no clue as to what the behavior of servers which
> > report negative offsets would be. I guess it may not matter -- if the
> > offset reported isn't the same as our request, we could just reset the
> > request to 2 GB and ask again...
>
> Well, it *might* be the same value we asked for, just treated as a signed
> 32bit value so that values between 2^31 to 2^32 create negatives. But I think
> you're right, if the value differs from our requested value (be it negative or
> not), we could start at the 2^32-1 point.
>
> This made me think though. The libcurl interface allows the app to set a
> RESUME_FROM point when doing a transfer. The application will then assume that
> the transfer will be made from that point and onwards (or fail). We currently
> have no means to pass back any feedback to the application that says "uh, we
> had to start from point N instead of point X that you asked for"...
>
> I'm not really sure how we solve this the nicest possible way...

The thought I had (and the one I'm working towards currently) is to make
the REST handler tell the document body writing code to skip some number
of bytes of server data. If the server's offset is 100 and our request
was 150, the document writing code would thus simply ignore the first 50
bytes of data. That way, even if we somehow fail in the transfer before
we've gotten any new data, we won't have accidentally set ourselves back:
the original stuff will remain unmodified, since we don't write any data
until we get to the offset that we originally requested. The only real
impact to an application that I can see would be that the destination
server would seem slow for the first bit (while we ignored the data it was
sending us).

Of course, the assumption I'm making here is that anytime data is received
from the server it eventually passes through Curl_client_write. If that's
not the case, then I'm not sure the solution I'm working on will actually
work in all cases...

Thanks,

Dave

-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills. Sign up for IBM's
Free Linux Tutorials. Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
Received on 2003-12-16