Commit 7da9c95b authored by Steve Holme's avatar Steve Holme
Browse files

ftpserver.pl: Added the ability to send custom full text replies

parent 95ae389e
Loading
Loading
Loading
Loading
+28 −19
Original line number Diff line number Diff line
@@ -3251,8 +3251,16 @@ 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 "")) {
            sendcontrol "$text\r\n";
            $check = 0;
        }
        else {
            # See if there is a custom reply for the command
            $text = $commandreply{$FTPCMD};
            if($text && ($text ne "")) {
                if($customcount{$FTPCMD} && (!--$customcount{$FTPCMD})) {
                    # used enough times so blank the custom command reply
@@ -3263,7 +3271,7 @@ while(1) {
                $check = 0;
            }
            else {
            # See if there is any display text for our command
                # See if there is any display text for the command
                $text = $displaytext{$FTPCMD};
                if($text && ($text ne "")) {
                    if($proto eq 'imap') {
@@ -3280,7 +3288,8 @@ while(1) {
                my $func = $commandfunc{$FTPCMD};
                if($func) {
                    &$func($FTPARG, $FTPCMD);
                $check=0; # taken care of
                    $check = 0;
                }
            }
        }