1
0
mirror of https://github.com/moparisthebest/curl synced 2024-08-13 17:03:50 -04:00

ftpserver.pl: Corrected flawed logic in commit 1ca6ed7b75

This commit is contained in:
Steve Holme 2013-08-31 11:10:20 +01:00
parent f3849a7b84
commit 5eea336d01

View File

@ -816,12 +816,17 @@ sub SELECT_imap {
sub FETCH_imap {
my ($args) = @_;
my ($uid, $how) = split(/ /, $args, 2);
my @data;
my $size;
fix_imap_params($uid, $how);
logmsg "FETCH_imap got $args\n";
if ($selected eq "") {
sendcontrol "$cmdid BAD Command received in Invalid state\r\n";
}
else {
my @data;
my $size;
if($selected eq "verifiedserver") {
# this is the secret command that verifies that this actually is
# the curl test server
@ -832,9 +837,6 @@ sub FETCH_imap {
$data[0] = $response;
logmsg "return proof we are we\n";
}
elsif ($selected eq "") {
sendcontrol "$cmdid BAD Command received in Invalid state\r\n";
}
else {
logmsg "retrieve a mail\n";
@ -864,6 +866,7 @@ sub FETCH_imap {
sendcontrol ")\r\n";
sendcontrol "$cmdid OK FETCH completed\r\n";
}
return 0;
}
@ -973,7 +976,10 @@ sub LIST_imap {
logmsg "LIST_imap got $args\n";
if ($reference eq "verifiedserver") {
if ($reference eq "") {
sendcontrol "$cmdid BAD Command Argument\r\n";
}
elsif ($reference eq "verifiedserver") {
# this is the secret command that verifies that this actually is
# the curl test server
sendcontrol "* LIST () \"/\" \"WE ROOLZ: $$\"\r\n";
@ -985,9 +991,6 @@ sub LIST_imap {
logmsg "return proof we are we\n";
}
elsif ($reference eq "") {
sendcontrol "$cmdid BAD Command Argument\r\n";
}
else {
my $testno = $reference;