cURL / Mailing Lists / curl-library / Single Mail


Re: End of Line Handling (affects ALL platforms)

From: Jamie Lokier <>
Date: Sat, 22 Apr 2006 16:37:14 +0100

Daniel Stenberg wrote:
> On Fri, 21 Apr 2006, David McCreedy wrote:
> >I think the existing check against SIZE and my new check against SIZE+line
> >end conversions are quite valuable. If the ascii mode transferred file
> >doesn't match either we definitively know that the transfer failed. And
> >that's worth passing on to the caller.
> Right - I'm convinced now. Let's go with that!

If the file on the server's disk contains a mixture of LF-only and
CRLF line endings, it seems likely the server will report the size of
that file, and convert the LF-only endings to CRLF, without changing
the existing CRLFs.

In which case, the client check against the two sizes will fail,
despite a successful transfer. It should be a range change: SIZE <=
received <= SIZE+line_ends.

Have I got that right?

-- Jamie
Received on 2006-04-22