1
0
mirror of https://github.com/moparisthebest/curl synced 2025-02-28 09:21:50 -05:00

ftpserver.pl: directory LISTings use [CR][LF] for ASCII transfer

According to section 2.2 of RFC959 the End-of-Line is defined as:
 The end-of-line sequence defines the separation of printing
 lines.  The sequence is Carriage Return, followed by Line Feed.

Verified by sniffing traffic between a Windows FTP client (FileZilla)
and Unix-hosted FTP server (ProFTPD).
This commit is contained in:
Marc Hoersken 2014-01-26 11:30:41 +01:00
parent 480ca49ecb
commit ca9ab24ed5

View File

@ -2160,6 +2160,9 @@ my @ftpdir=("total 20\r\n",
my @data = getpart("reply", "data");
for(@data) {
my $send = $_;
# convert all \n to \r\n for ASCII transfer
$send =~ s/\r\n/\n/g;
$send =~ s/\n/\r\n/g;
logmsg "send $send as data\n";
senddata $send;
}