RE: FTP large file support patch
Date: Wed, 17 Dec 2003 09:46:23 +0100 (CET)
On Tue, 16 Dec 2003, DOMINICK C MEGLIO wrote:
> > That will address the concern previously posted by Dominick Meglio.
> Actually I was referring to something different. There may be instances
> where even if it is a >2GB file that you do NOT want this feature.
Well, the problem with such an approach is of course that no one will ever
know beforehand if they need this feature or not, unless they first attempt
this operation on the server behaving like this.
That would require all resume-using ftp tranfer applications to have to retry
failed transfers with this option toggled before they know for sure that this
operation doesn't work...
> The way he said he was going to implement it was to search for the first
> number in the 350 response. Ok, I'm not an expert on FTP, but to my
> knowledge, there really is no standardized format for the text of a response
Yes, this is indeed a dangerous path to walk down and parsing for a number in
the text-response is error-prone.
I still don't see how to avoid that in a nice way. Perhaps having the parsing
enabled by default, with an option to disable it...
> But in any case, I'd say in 99% of the cases, what he stated will work. But
> what if the reply were:
> 350 Restarting at 3,000,000,000. Send STOR or RETR
> If he simply searches for the first number, that means he is going to begin
> at byte 3 which is clearly not what that message intends. And of course
> simply saying "well I'll make it skip ," isn't a good fix either because in
> some countries they use a . for a thousands-seperator.
The good part about Dave Meyer's suggestion on how to handle this case, is
that when this happens it will only get a performance hit as it will attempt a
REST 2^31 instead (without text parsing).
> My point is simply that parsing a text string that has no specified format
> such as this can lead to the possibility that there is some server out there
> on which it will not work.
libcurl is already doing text parsing for the RETR response, and believe it or
not, but it works on a fair amount of all the ftp servers out there. And that
response has no documented format either.
-- Daniel Stenberg -- http://curl.haxx.se/ -- http://daniel.haxx.se/ [[ Do not send mails to this email address. They won't reach me. ]] ------------------------------------------------------- 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=clickReceived on 2003-12-17