added support for RETRNOSIZE in the control file to tell RETR to not
include size in the 150-reply
This commit is contained in:
		@@ -27,6 +27,7 @@ sub ftpmsg { print INPUT @_; }
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
my $verbose=0; # set to 1 for debugging
 | 
					my $verbose=0; # set to 1 for debugging
 | 
				
			||||||
my $retrweirdo=0;
 | 
					my $retrweirdo=0;
 | 
				
			||||||
 | 
					my $retrnosize=0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
my $port = 8921; # just a default
 | 
					my $port = 8921; # just a default
 | 
				
			||||||
do {
 | 
					do {
 | 
				
			||||||
@@ -240,8 +241,13 @@ sub RETR_command {
 | 
				
			|||||||
            $retrweirdo=0; # switch off the weirdo again!
 | 
					            $retrweirdo=0; # switch off the weirdo again!
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        else {
 | 
					        else {
 | 
				
			||||||
            print "150 Binary data connection for $testno () ($size bytes).\r\n";
 | 
					            my $sz = "($size bytes)";
 | 
				
			||||||
            logmsg "150 Binary data connection for $testno ($size bytes).\n";
 | 
					            if($retrnosize) {
 | 
				
			||||||
 | 
					                $sz = "size?";
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            print "150 Binary data connection for $testno () $sz.\r\n";
 | 
				
			||||||
 | 
					            logmsg "150 Binary data connection for $testno () $sz.\n";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            for(@data) {
 | 
					            for(@data) {
 | 
				
			||||||
                my $send = $_;
 | 
					                my $send = $_;
 | 
				
			||||||
@@ -386,6 +392,10 @@ sub customize {
 | 
				
			|||||||
            print "instructed to use RETRWEIRDO\n";
 | 
					            print "instructed to use RETRWEIRDO\n";
 | 
				
			||||||
            $retrweirdo=1;
 | 
					            $retrweirdo=1;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					        elsif($_ =~ /RETRNOSIZE/) {
 | 
				
			||||||
 | 
					            print "instructed to use RETRNOSIZE\n";
 | 
				
			||||||
 | 
					            $retrnosize=1;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    close(CUSTOM);
 | 
					    close(CUSTOM);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user