ftpserver.pl: Corrected misaligned indentation in POP3 handlers
Fixed incorrect indentation used in both the RETR_pop3 and LIST_pop3 functions which was 5 and 9 characters rather than 4 and 8.
This commit is contained in:
@@ -1231,69 +1231,68 @@ sub AUTH_pop3 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
sub RETR_pop3 {
|
sub RETR_pop3 {
|
||||||
my ($testno) = @_;
|
my ($testno) = @_;
|
||||||
my @data;
|
my @data;
|
||||||
|
|
||||||
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";
|
||||||
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";
|
||||||
}
|
}
|
||||||
$data[0] = $response;
|
$data[0] = $response;
|
||||||
logmsg "return proof we are we\n";
|
logmsg "return proof we are we\n";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
logmsg "retrieve a mail\n";
|
logmsg "retrieve a mail\n";
|
||||||
|
|
||||||
$testno =~ s/^([^0-9]*)//;
|
$testno =~ s/^([^0-9]*)//;
|
||||||
my $testpart = "";
|
my $testpart = "";
|
||||||
if ($testno > 10000) {
|
if ($testno > 10000) {
|
||||||
$testpart = $testno % 10000;
|
$testpart = $testno % 10000;
|
||||||
$testno = int($testno / 10000);
|
$testno = int($testno / 10000);
|
||||||
}
|
}
|
||||||
|
|
||||||
# send mail content
|
# send mail content
|
||||||
loadtest("$srcdir/data/test$testno");
|
loadtest("$srcdir/data/test$testno");
|
||||||
|
|
||||||
@data = getpart("reply", "data$testpart");
|
@data = getpart("reply", "data$testpart");
|
||||||
}
|
}
|
||||||
|
|
||||||
sendcontrol "+OK Mail transfer starts\r\n";
|
sendcontrol "+OK Mail transfer starts\r\n";
|
||||||
|
|
||||||
for my $d (@data) {
|
for my $d (@data) {
|
||||||
sendcontrol $d;
|
sendcontrol $d;
|
||||||
}
|
}
|
||||||
|
|
||||||
# end with the magic 3-byte end of mail marker, assumes that the
|
# end with the magic 3-byte end of mail marker, assumes that the
|
||||||
# mail body ends with a CRLF!
|
# mail body ends with a CRLF!
|
||||||
sendcontrol ".\r\n";
|
sendcontrol ".\r\n";
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
sub LIST_pop3 {
|
sub LIST_pop3 {
|
||||||
|
# This is a built-in fake-message list
|
||||||
|
my @data = (
|
||||||
|
"1 100\r\n",
|
||||||
|
"2 4294967400\r\n", # > 4 GB
|
||||||
|
"4 200\r\n", # Note that message 3 is a simulated "deleted" message
|
||||||
|
);
|
||||||
|
|
||||||
# this is a built-in fake-message list
|
logmsg "retrieve a message list\n";
|
||||||
my @pop3list=(
|
|
||||||
"1 100\r\n",
|
|
||||||
"2 4294967400\r\n", # > 4 GB
|
|
||||||
"4 200\r\n", # Note that message 3 is a simulated "deleted" message
|
|
||||||
);
|
|
||||||
|
|
||||||
logmsg "retrieve a message list\n";
|
sendcontrol "+OK Listing starts\r\n";
|
||||||
|
|
||||||
sendcontrol "+OK Listing starts\r\n";
|
for my $d (@data) {
|
||||||
|
sendcontrol $d;
|
||||||
|
}
|
||||||
|
|
||||||
for my $d (@pop3list) {
|
# End with the magic 3-byte end of listing marker
|
||||||
sendcontrol $d;
|
sendcontrol ".\r\n";
|
||||||
}
|
|
||||||
|
|
||||||
# end with the magic 3-byte end of listing marker
|
return 0;
|
||||||
sendcontrol ".\r\n";
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sub DELE_pop3 {
|
sub DELE_pop3 {
|
||||||
|
|||||||
Reference in New Issue
Block a user