aboutsummaryrefslogtreecommitdiff
path: root/tests/ftpserver.pl
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2017-12-01 00:45:46 +0100
committerDaniel Stenberg <daniel@haxx.se>2017-12-05 17:05:44 +0100
commit615edc1f73090f5f876f1491f9658f6429fdf481 (patch)
treeed060508a315f6ca306a6d1ab492b6687f8f3f40 /tests/ftpserver.pl
parent4401409468f590520dd5d0f0a55607eefa5ff4c1 (diff)
sasl_getmesssage: make sure we have a long enough string to pass
For pop3/imap/smtp, added test 891 to somewhat verify the pop3 case. For this, I enhanced the pingpong test server to be able to send back responses with LF-only instead of always using CRLF. Closes #2150
Diffstat (limited to 'tests/ftpserver.pl')
-rwxr-xr-xtests/ftpserver.pl16
1 files changed, 11 insertions, 5 deletions
diff --git a/tests/ftpserver.pl b/tests/ftpserver.pl
index ae8b4a017..956275881 100755
--- a/tests/ftpserver.pl
+++ b/tests/ftpserver.pl
@@ -2755,13 +2755,19 @@ sub customize {
$fulltextreply{$1}=eval "qq{$2}";
logmsg "FTPD: set custom reply for $1\n";
}
- elsif($_ =~ /REPLY ([A-Za-z0-9+\/=\*]*) (.*)/) {
- $commandreply{$1}=eval "qq{$2}";
- if($1 eq "") {
+ elsif($_ =~ /REPLY(LF|) ([A-Za-z0-9+\/=\*]*) (.*)/) {
+ $commandreply{$2}=eval "qq{$3}";
+ if($1 ne "LF") {
+ $commandreply{$2}.="\r\n";
+ }
+ else {
+ $commandreply{$2}.="\n";
+ }
+ if($2 eq "") {
logmsg "FTPD: set custom reply for empty command\n";
}
else {
- logmsg "FTPD: set custom reply for $1 command\n";
+ logmsg "FTPD: set custom reply for $2 command\n";
}
}
elsif($_ =~ /COUNT ([A-Z]+) (.*)/) {
@@ -3175,7 +3181,7 @@ while(1) {
$commandreply{$FTPCMD}="";
}
- sendcontrol "$text\r\n";
+ sendcontrol $text;
$check = 0;
}
else {