cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: End of Line Handling (affects ALL platforms)

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Wed, 19 Apr 2006 08:17:51 +0200 (CEST)

On Wed, 12 Apr 2006, David McCreedy wrote:

(Sorry it has taken a while to respond, but I do keep them in my pipe and I
will deal with each as soon as I have time.)

> 1) Almost all FTP servers I've tried give the same SIZE regardless of the
> mode (bin vs ascii) of the download. (Some servers do go to the extra
> trouble of calculating the SIZE accurately for ascii mode transfers.) For
> example, let's use an FTP server on a platform that uses LF for the
> end-of-line marker. If the file is 50 bytes long (natively) with 10
> lineends, the SIZE will usually be given as 50 bytes. That's correct for bin
> mode. But for ASCII mode those LFs become CRLFs and we get 60 bytes from the
> server. So we get a "partial" file with -10 bytes left to read. I've tracked
> the number of CRLFs Curl converted so we can try to determine if the size
> difference was really a partial file or just lineend related.

Doesn't the "Almost all" and "some" of the paragraph above make such a
calculation and assumption rather error-prone?

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
Received on 2006-04-19