moved lots of the verbose stuff to do logmsg instead

This commit is contained in:
Daniel Stenberg
2001-09-13 12:52:24 +00:00
parent afa7648be6
commit 600d7b11e6

View File

@@ -118,6 +118,7 @@ my %commandfunc = ( 'PORT' => \&PORT_command,
my $rest=0; my $rest=0;
sub REST_command { sub REST_command {
$rest = $_[0]; $rest = $_[0];
logmsg "Set REST position to $rest\n"
} }
sub LIST_command { sub LIST_command {
@@ -160,6 +161,8 @@ sub NLST_command {
sub SIZE_command { sub SIZE_command {
my $testno = $_[0]; my $testno = $_[0];
loadtest("data/test$testno");
logmsg "SIZE number $testno\n"; logmsg "SIZE number $testno\n";
my @data = getpart("reply", "size"); my @data = getpart("reply", "size");
@@ -168,9 +171,11 @@ sub SIZE_command {
if($size) { if($size) {
print "213 $size\r\n"; print "213 $size\r\n";
logmsg "SIZE $testno returned $size\n";
} }
else { else {
print "550 $testno: No such file or directory.\r\n"; print "550 $testno: No such file or directory.\r\n";
logmsg "SIZE $testno: no such file\n";
} }
return 0; return 0;
} }
@@ -204,18 +209,14 @@ sub RETR_command {
if($rest) { if($rest) {
# move read pointer forward # move read pointer forward
$size -= $rest; $size -= $rest;
if($verbose) { logmsg "REST $rest was removed from size, makes $size left\n";
print STDERR "** REST $rest was removed from size.\n";
}
} }
print "150 Binary data connection for $testno () ($size bytes).\r\n"; print "150 Binary data connection for $testno () ($size bytes).\r\n";
$rest=0; # reset rest again logmsg "150 Binary data connection for $testno ($size bytes).\n";
if($verbose) {
print STDERR "150 Binary data connection for $testno ($size bytes).\n";
}
for(@data) { for(@data) {
print SOCK $_; my $send = $_;
print SOCK $send;
} }
close(SOCK); close(SOCK);
@@ -223,9 +224,7 @@ sub RETR_command {
} }
else { else {
print "550 $testno: No such file or directory.\r\n"; print "550 $testno: No such file or directory.\r\n";
if($verbose) { logmsg "550 $testno: no such file\n";
print STDERR "550 $testno: no such file\n";
}
} }
return 0; return 0;
} }
@@ -331,9 +330,7 @@ sub customize {
open(CUSTOM, "<log/ftpserver.cmd") || open(CUSTOM, "<log/ftpserver.cmd") ||
return 1; return 1;
if($verbose) { logmsg "FTPD: Getting commands from log/ftpserver.cmd\n";
print STDERR "FTPD: Getting commands from log/ftpserver.cmd\n";
}
while(<CUSTOM>) { while(<CUSTOM>) {
if($_ =~ /REPLY ([A-Z]+) (.*)/) { if($_ =~ /REPLY ([A-Z]+) (.*)/) {