]> granicus.if.org Git - curl/commitdiff
ftpserver: output CRLF in logs
authorDaniel Stenberg <daniel@haxx.se>
Tue, 29 Nov 2011 12:41:10 +0000 (13:41 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Tue, 29 Nov 2011 12:43:12 +0000 (13:43 +0100)
Previously the log function would just filter out all CR and LF
occurances from the log to make it more readable. This had the downside
that it made it very hard to see CR LFs when they actually matters.

Now, they're instead converted to "[CR]" and "[LR]" in the log to become
apparent to readers.

tests/ftpserver.pl

index 99722bb8c57e12d9eedcfd1f612c4c247926bda2..e9f988e8bdc81dd6ffecf817852221448e4998f0 100755 (executable)
@@ -327,7 +327,8 @@ sub sendcontrol {
     my $log;
     foreach $log (@_) {
         my $l = $log;
-        $l =~ s/[\r\n]//g;
+        $l =~ s/\r/[CR]/g;
+        $l =~ s/\n/[LF]/g;
         logmsg "> \"$l\"\n";
     }
 }