cURL / Mailing Lists / curl-library / Single Mail

curl-library

FTP large file support patch

From: Dave Meyer <meyer_at_paracel.com>
Date: Tue, 9 Dec 2003 15:32:48 -0800 (PST)

Howdy,

Quick preface: I see that Rob Braun has submitted a patch or two for
trying to deal with files larger than 2 GB with http. Sadly, I did not
see that until *after* I fiddled around with ftp support for the same on
my own. Perhaps I can look at a later patch that moves my stuff to
conform more to what he has already done...

This patch adds large file support for ftp transactions in particular,
although it probably messes around a little bit with how transactions in
other protocols occur. This solution relies on the use of the off_t data
type, meaning that it gives large file support on supporting platforms by
setting using -D_FILE_OFFSET_BITS=64 or an equivalent thereof.

Note that I've also included support for specifying resume offsets which
are larger than 2 GB, which means that the Curl_setopt function has
changed the sizes of some of its arguments from long to off_t. I've
attempted to update the documentation for the relevant option keys in
addition to changing the keys themselves.

Finally, several of the places that once used atoi or strtol to scan text
for numbers have been replaced with calls to strtoll (or a new function
called str2offset which mimics the behavior of str2num, but with off_t's
rather than longs). This allows numbers larger than 2 GB to actually be
read properly out of the strings in which they appear.

Related to this, I have a question about dealing with broken ftp servers,
but I'll put that into a separate email.

Thanks,

Dave Meyer
Software Engineer
Paracel, Inc.

-------------------------------------------------------
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-10