NLST does a LIST (a normal unix ftp client 'ls' becomes NLST)

multiple transfers are supported
This commit is contained in:
Daniel Stenberg
2000-11-21 13:36:55 +00:00
parent bdb411c6ca
commit 70778f2cb6

View File

@@ -64,10 +64,11 @@ sub REAPER {
my %commandok = ( my %commandok = (
"USER" => "fresh", "USER" => "fresh",
"PASS" => "passwd", "PASS" => "passwd",
"PASV" => "loggedin", "PASV" => "loggedin|twosock",
"PORT" => "loggedin", "PORT" => "loggedin|twosock",
"TYPE" => "loggedin|twosock", "TYPE" => "loggedin|twosock",
"LIST" => "twosock", "LIST" => "twosock",
"NLST" => "twosock",
"RETR" => "twosock", "RETR" => "twosock",
"STOR" => "twosock", "STOR" => "twosock",
"CWD" => "loggedin", "CWD" => "loggedin",
@@ -88,6 +89,7 @@ my %displaytext = ('USER' => '331 We are happy you popped in!', # output FTP lin
'PORT' => '200 You said PORT - I say FINE', 'PORT' => '200 You said PORT - I say FINE',
'TYPE' => '200 I modify TYPE as you wanted', 'TYPE' => '200 I modify TYPE as you wanted',
'LIST' => '150 here comes a directory', 'LIST' => '150 here comes a directory',
'NLST' => '150 here comes a directory',
'CWD' => '250 CWD command successful.', 'CWD' => '250 CWD command successful.',
'QUIT' => '221 bye bye baby', 'QUIT' => '221 bye bye baby',
); );
@@ -95,6 +97,7 @@ my %displaytext = ('USER' => '331 We are happy you popped in!', # output FTP lin
# callback functions for certain commands # callback functions for certain commands
my %commandfunc = ( 'PORT' => \&PORT_command, my %commandfunc = ( 'PORT' => \&PORT_command,
'LIST' => \&LIST_command, 'LIST' => \&LIST_command,
'NLST' => \&LIST_command, # use LIST for now
'PASV' => \&PASV_command, 'PASV' => \&PASV_command,
'RETR' => \&RETR_command, 'RETR' => \&RETR_command,
'SIZE' => \&SIZE_command, 'SIZE' => \&SIZE_command,
@@ -120,7 +123,6 @@ sub LIST_command {
logmsg "$$: pass data to child pid\n"; logmsg "$$: pass data to child pid\n";
for(@ftpdir) { for(@ftpdir) {
print SOCK $_; print SOCK $_;
print STDERR "PASS: $_";
} }
close(SOCK); close(SOCK);
logmsg "$$: done passing data to child pid\n"; logmsg "$$: done passing data to child pid\n";
@@ -186,7 +188,7 @@ sub STOR_command {
my $filename = "log/ftpout.$testno"; my $filename = "log/ftpout.$testno";
print "200 Gimme gimme gimme!\r\n"; print "125 Gimme gimme gimme!\r\n";
open(FILE, ">$filename") || open(FILE, ">$filename") ||
return 0; # failed to open output return 0; # failed to open output