tests: Fix ftpserver.pl indentation

The whole of FETCH_imap() had one extra space of indentation, whilst
APPEND_imap() used indentation of 2 instead of 4 in places.
This commit is contained in:
Jiri Hruska 2013-03-10 20:23:27 +01:00 committed by Steve Holme
parent 62b5015796
commit c2e2938a7e
1 changed files with 46 additions and 46 deletions

View File

@ -804,54 +804,54 @@ sub SELECT_imap {
} }
sub FETCH_imap { sub FETCH_imap {
my ($args) = @_; my ($args) = @_;
my ($uid, $how) = split(/ /, $args, 2); my ($uid, $how) = split(/ /, $args, 2);
my @data; my @data;
my $size; my $size;
logmsg "FETCH_imap got $args\n"; logmsg "FETCH_imap got $args\n";
if($selected =~ /^verifiedserver$/) { if($selected =~ /^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";
my $testno = $selected; my $testno = $selected;
$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");
} }
for (@data) { for (@data) {
$size += length($_); $size += length($_);
} }
sendcontrol "* $uid FETCH ($how {$size}\r\n"; sendcontrol "* $uid FETCH ($how {$size}\r\n";
for my $d (@data) { for my $d (@data) {
sendcontrol $d; sendcontrol $d;
} }
sendcontrol ")\r\n"; sendcontrol ")\r\n";
sendcontrol "$cmdid OK FETCH completed\r\n"; sendcontrol "$cmdid OK FETCH completed\r\n";
return 0; return 0;
} }
sub APPEND_imap { sub APPEND_imap {
@ -889,18 +889,18 @@ sub APPEND_imap {
my $datasize = ($left > $chunksize) ? $chunksize : $left; my $datasize = ($left > $chunksize) ? $chunksize : $left;
if($datasize > 0) { if($datasize > 0) {
logmsg "> Appending $datasize bytes to file\n"; logmsg "> Appending $datasize bytes to file\n";
print FILE substr($line, 0, $datasize) if(!$nosave); print FILE substr($line, 0, $datasize) if(!$nosave);
$line = substr($line, $datasize); $line = substr($line, $datasize);
$received += $datasize; $received += $datasize;
if($received == $size) { if($received == $size) {
logmsg "Received all data, waiting for final CRLF.\n"; logmsg "Received all data, waiting for final CRLF.\n";
} }
} }
if($received == $size && $line eq "\r\n") { if($received == $size && $line eq "\r\n") {
last; last;
} }
} }
elsif($line eq "DISC\n") { elsif($line eq "DISC\n") {