diff options
author | Steve Holme <steve_holme@hotmail.com> | 2013-12-22 19:10:43 +0000 |
---|---|---|
committer | Steve Holme <steve_holme@hotmail.com> | 2013-12-22 19:36:07 +0000 |
commit | 7da9c95bcf1fe6be41de0081188ee0a04ac4db17 (patch) | |
tree | 0b2de20e0bfde35bdc4d8f76814a5ff43a9f6d46 /tests/ftpserver.pl | |
parent | 95ae389e17c052464ba22b47fe7ef39a61119c3e (diff) | |
download | curl-7da9c95bcf1fe6be41de0081188ee0a04ac4db17.tar.gz |
ftpserver.pl: Added the ability to send custom full text replies
Diffstat (limited to 'tests/ftpserver.pl')
-rwxr-xr-x | tests/ftpserver.pl | 47 |
1 files changed, 28 insertions, 19 deletions
diff --git a/tests/ftpserver.pl b/tests/ftpserver.pl index c4cd7cf0e..3a4a0795c 100755 --- a/tests/ftpserver.pl +++ b/tests/ftpserver.pl @@ -3251,36 +3251,45 @@ while(1) { my $check = 1; # no response yet - # See if there is a custom reply for our command - my $text = $commandreply{$FTPCMD}; + # See if there is a custom reply for the full text + my $fulltext = $FTPCMD . " " . $FTPARG; + my $text = $fulltextreply{$fulltext}; if($text && ($text ne "")) { - if($customcount{$FTPCMD} && (!--$customcount{$FTPCMD})) { - # used enough times so blank the custom command reply - $commandreply{$FTPCMD}=""; - } - sendcontrol "$text\r\n"; $check = 0; } else { - # See if there is any display text for our command - $text = $displaytext{$FTPCMD}; + # See if there is a custom reply for the command + $text = $commandreply{$FTPCMD}; if($text && ($text ne "")) { - if($proto eq 'imap') { - sendcontrol "$cmdid $text\r\n"; - } - else { - sendcontrol "$text\r\n"; + if($customcount{$FTPCMD} && (!--$customcount{$FTPCMD})) { + # used enough times so blank the custom command reply + $commandreply{$FTPCMD}=""; } + sendcontrol "$text\r\n"; $check = 0; } + else { + # See if there is any display text for the command + $text = $displaytext{$FTPCMD}; + if($text && ($text ne "")) { + if($proto eq 'imap') { + sendcontrol "$cmdid $text\r\n"; + } + else { + sendcontrol "$text\r\n"; + } - # only perform this if we're not faking a reply - my $func = $commandfunc{$FTPCMD}; - if($func) { - &$func($FTPARG, $FTPCMD); - $check=0; # taken care of + $check = 0; + } + + # only perform this if we're not faking a reply + my $func = $commandfunc{$FTPCMD}; + if($func) { + &$func($FTPARG, $FTPCMD); + $check = 0; + } } } |