cURL / Mailing Lists / curl-library / Single Mail


RE: Broken libcurl FTP list parsing

From: Steve Holme <>
Date: Sun, 26 Jan 2014 18:54:03 +0000

On Sun, 26 Jan 2014, Marc Hörsken wrote:

> > We had the same problem in the IMAP, POP3 and SMTP tests - and what we
> > have done there is to include CRLF in the data lines of the data
> > section. With your proposed fix we could do the same for those
> > protocols so that the correct line ending don't need to be included in
> > the data section of the test specification.
> As far as I understand it, changing the data section to [CR][LF] would
> the FTP tests on Unix systems, since there the LISTing output should be
> converted to [LF].

That's the bit I'm not sure about... and got really confused over when
Daniel sent me some log files last month!

I believe that the server sends CRLF for Test 101, 102, etc... and
previously Test 100, as can be seen in the output of ftp_sockdata.log and
from the line ending code in - If I have understood that code

However, the datacheck sections of those tests contain LF only - so where is
that conversion/stripping happening?

> > Modifying these functions to automatically include the line ending if
> > it wasn't specified and correct it if it was would mean that this sort
> > of thing wouldn’t happen in the future ;-) As senddata() can contain
> > binary data we would have to take than into consideration.
> I personally do think that we should take care of the correct line ending
> outside of these functions, since there might be protocols that actually
> do send text data with [LF] line-endings, even on Windows.

My understanding is that, these functions are in and as such
are only implemented for FTP like ping pong protocols (FTP, IMAP, POP3 and
SMTP) - all of this protocols use CRLF for command responses and textual

I'm not a fan of fixing up the test files, like what we have done so far, as
it means that the test files have a mixture of CRLF and LF characters in
them that a) text editors don’t like, b) get missed when reviewing and c)
might not be present in patch files. I think your appreciate is a lot better
- I just don't fancy fixing up all areas of the email protocols where we
call sendcontrol() with the same two lines of regex. Senddata() I believe is
only used in FTP as it is the only protocol that implements a data channel.

Kind Regards


List admin:
Received on 2014-01-26