mirror of
https://github.com/moparisthebest/curl
synced 2024-12-21 15:48:49 -05:00
removed lots of (now) redundant logging
This commit is contained in:
parent
6078c938b2
commit
cea117b509
@ -331,8 +331,6 @@ sub MDTM_command {
|
|||||||
|
|
||||||
loadtest("$srcdir/data/test$testno");
|
loadtest("$srcdir/data/test$testno");
|
||||||
|
|
||||||
logmsg "MDTM $testno\n";
|
|
||||||
|
|
||||||
my @data = getpart("reply", "mdtm");
|
my @data = getpart("reply", "mdtm");
|
||||||
|
|
||||||
my $reply = $data[0];
|
my $reply = $data[0];
|
||||||
@ -340,15 +338,12 @@ sub MDTM_command {
|
|||||||
|
|
||||||
if($reply <0) {
|
if($reply <0) {
|
||||||
sendcontrol "550 $testno: no such file.\r\n";
|
sendcontrol "550 $testno: no such file.\r\n";
|
||||||
logmsg "MDTM $testno: no such file\n";
|
|
||||||
}
|
}
|
||||||
elsif($reply) {
|
elsif($reply) {
|
||||||
sendcontrol "$reply\r\n";
|
sendcontrol "$reply\r\n";
|
||||||
logmsg "MDTM $testno returned $reply\n";
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
sendcontrol "500 MDTM: no such command.\r\n";
|
sendcontrol "500 MDTM: no such command.\r\n";
|
||||||
logmsg "MDTM: no such command\n";
|
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -358,13 +353,10 @@ sub SIZE_command {
|
|||||||
|
|
||||||
loadtest("$srcdir/data/test$testno");
|
loadtest("$srcdir/data/test$testno");
|
||||||
|
|
||||||
logmsg "SIZE file \"$testno\"\n";
|
|
||||||
|
|
||||||
if($testno eq "verifiedserver") {
|
if($testno eq "verifiedserver") {
|
||||||
my $response = "WE ROOLZ: $$\r\n";
|
my $response = "WE ROOLZ: $$\r\n";
|
||||||
my $size = length($response);
|
my $size = length($response);
|
||||||
sendcontrol "213 $size\r\n";
|
sendcontrol "213 $size\r\n";
|
||||||
logmsg "SIZE $testno returned $size\n";
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -375,11 +367,9 @@ sub SIZE_command {
|
|||||||
if($size) {
|
if($size) {
|
||||||
if($size > -1) {
|
if($size > -1) {
|
||||||
sendcontrol "213 $size\r\n";
|
sendcontrol "213 $size\r\n";
|
||||||
logmsg "SIZE $testno returned $size\n";
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
sendcontrol "550 $testno: No such file or directory.\r\n";
|
sendcontrol "550 $testno: No such file or directory.\r\n";
|
||||||
logmsg "SIZE $testno: no such file\n";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -390,11 +380,9 @@ sub SIZE_command {
|
|||||||
}
|
}
|
||||||
if($size) {
|
if($size) {
|
||||||
sendcontrol "213 $size\r\n";
|
sendcontrol "213 $size\r\n";
|
||||||
logmsg "SIZE $testno returned $size\n";
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
sendcontrol "550 $testno: No such file or directory.\r\n";
|
sendcontrol "550 $testno: No such file or directory.\r\n";
|
||||||
logmsg "SIZE $testno: no such file\n";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
@ -403,23 +391,18 @@ sub SIZE_command {
|
|||||||
sub RETR_command {
|
sub RETR_command {
|
||||||
my ($testno) = @_;
|
my ($testno) = @_;
|
||||||
|
|
||||||
logmsg "RETR file \"$testno\"\n";
|
|
||||||
|
|
||||||
if($testno =~ /^verifiedserver$/) {
|
if($testno =~ /^verifiedserver$/) {
|
||||||
# this is the secret command that verifies that this actually is
|
# this is the secret command that verifies that this actually is
|
||||||
# the curl test server
|
# the curl test server
|
||||||
my $response = "WE ROOLZ: $$\r\n";
|
my $response = "WE ROOLZ: $$\r\n";
|
||||||
my $len = length($response);
|
my $len = length($response);
|
||||||
sendcontrol "150 Binary junk ($len bytes).\r\n";
|
sendcontrol "150 Binary junk ($len bytes).\r\n";
|
||||||
logmsg "pass our pid on the data connection\n";
|
|
||||||
senddata "WE ROOLZ: $$\r\n";
|
senddata "WE ROOLZ: $$\r\n";
|
||||||
close_dataconn(0);
|
close_dataconn(0);
|
||||||
logmsg "Data sent, sending a 226-reponse now\n";
|
|
||||||
sendcontrol "226 File transfer complete\r\n";
|
sendcontrol "226 File transfer complete\r\n";
|
||||||
if($verbose) {
|
if($verbose) {
|
||||||
print STDERR "FTPD: We returned proof we are the test server\n";
|
print STDERR "FTPD: We returned proof we are the test server\n";
|
||||||
}
|
}
|
||||||
logmsg "we returned proof that we are the test server\n";
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -447,9 +430,7 @@ sub RETR_command {
|
|||||||
if($retrweirdo) {
|
if($retrweirdo) {
|
||||||
sendcontrol "150 Binary data connection for $testno () ($size bytes).\r\n",
|
sendcontrol "150 Binary data connection for $testno () ($size bytes).\r\n",
|
||||||
"226 File transfer complete\r\n";
|
"226 File transfer complete\r\n";
|
||||||
logmsg "150+226 in one shot!\n";
|
|
||||||
|
|
||||||
logmsg "pass RETR data on data connection\n";
|
|
||||||
for(@data) {
|
for(@data) {
|
||||||
my $send = $_;
|
my $send = $_;
|
||||||
senddata $send;
|
senddata $send;
|
||||||
@ -464,9 +445,7 @@ sub RETR_command {
|
|||||||
}
|
}
|
||||||
|
|
||||||
sendcontrol "150 Binary data connection for $testno () $sz.\r\n";
|
sendcontrol "150 Binary data connection for $testno () $sz.\r\n";
|
||||||
logmsg "150 Binary data connection for $testno () $sz.\n";
|
|
||||||
|
|
||||||
logmsg "pass RETR data on data connection\n";
|
|
||||||
for(@data) {
|
for(@data) {
|
||||||
my $send = $_;
|
my $send = $_;
|
||||||
senddata $send;
|
senddata $send;
|
||||||
@ -477,7 +456,6 @@ sub RETR_command {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
sendcontrol "550 $testno: No such file or directory.\r\n";
|
sendcontrol "550 $testno: No such file or directory.\r\n";
|
||||||
logmsg "550 $testno: no such file\n";
|
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -491,8 +469,6 @@ sub STOR_command {
|
|||||||
|
|
||||||
sendcontrol "125 Gimme gimme gimme!\r\n";
|
sendcontrol "125 Gimme gimme gimme!\r\n";
|
||||||
|
|
||||||
logmsg "retrieve STOR data on data connection\n";
|
|
||||||
|
|
||||||
open(FILE, ">$filename") ||
|
open(FILE, ">$filename") ||
|
||||||
return 0; # failed to open output
|
return 0; # failed to open output
|
||||||
|
|
||||||
@ -500,7 +476,6 @@ sub STOR_command {
|
|||||||
my $ulsize=0;
|
my $ulsize=0;
|
||||||
my $disc=0;
|
my $disc=0;
|
||||||
while (5 == (sysread DREAD, $line, 5)) {
|
while (5 == (sysread DREAD, $line, 5)) {
|
||||||
logmsg "command from sockfilt: $line";
|
|
||||||
if($line eq "DATA\n") {
|
if($line eq "DATA\n") {
|
||||||
my $i;
|
my $i;
|
||||||
sysread DREAD, $i, 5;
|
sysread DREAD, $i, 5;
|
||||||
@ -518,7 +493,6 @@ sub STOR_command {
|
|||||||
}
|
}
|
||||||
elsif($line eq "DISC\n") {
|
elsif($line eq "DISC\n") {
|
||||||
# disconnect!
|
# disconnect!
|
||||||
logmsg "DISC means disconnect!\n";
|
|
||||||
$disc=1;
|
$disc=1;
|
||||||
last;
|
last;
|
||||||
}
|
}
|
||||||
@ -648,7 +622,6 @@ sub PORT_command {
|
|||||||
# EPRT |2|::1|49706|
|
# EPRT |2|::1|49706|
|
||||||
elsif(($cmd eq "EPRT") && ($grok_eprt)) {
|
elsif(($cmd eq "EPRT") && ($grok_eprt)) {
|
||||||
if($arg !~ /(\d+)\|([^\|]+)\|(\d+)/) {
|
if($arg !~ /(\d+)\|([^\|]+)\|(\d+)/) {
|
||||||
logmsg "bad EPRT-line: $arg\n";
|
|
||||||
sendcontrol "500 silly you, go away\r\n";
|
sendcontrol "500 silly you, go away\r\n";
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -656,7 +629,6 @@ sub PORT_command {
|
|||||||
$port = $3;
|
$port = $3;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
logmsg "got a $cmd line we don't like\n";
|
|
||||||
sendcontrol "500 we don't like $cmd now\r\n";
|
sendcontrol "500 we don't like $cmd now\r\n";
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -823,7 +795,6 @@ while(1) {
|
|||||||
|
|
||||||
unless (m/^([A-Z]{3,4})\s?(.*)/i) {
|
unless (m/^([A-Z]{3,4})\s?(.*)/i) {
|
||||||
sendcontrol "500 '$_': command not understood.\r\n";
|
sendcontrol "500 '$_': command not understood.\r\n";
|
||||||
logmsg "unknown crap received: $_, bailing out hard\n";
|
|
||||||
last;
|
last;
|
||||||
}
|
}
|
||||||
my $FTPCMD=$1;
|
my $FTPCMD=$1;
|
||||||
|
Loading…
Reference in New Issue
Block a user