"TYPE" => "loggedin|twosock",
"LIST" => "twosock",
"RETR" => "twosock",
+ "CWD" => "loggedin",
);
# initially, we're in 'fresh' state
'PORT' => '200 You said PORT - I say FINE',
'TYPE' => '200 I modify TYPE as you wanted',
'LIST' => '150 here comes a directory',
+ 'CWD' => '250 CWD command successful.',
+
);
# callback functions for certain commands
# this code is forked and run
spawn sub {
+
+ open(INPUT, ">log/server.input") ||
+ logmsg "failed to open log/server.input\n";
+
# < 220 pm1 FTP server (SunOS 5.7) ready.
# > USER anonymous
# < 331 Guest login ok, send ident as password.
last unless defined ($_ = <STDIN>);
+
# Remove trailing CRLF.
s/[\n\r]+$//;
my $full=$_;
logmsg "GOT: ($1) $_\n";
+ print INPUT "$$: $full\n";
my $ok = $commandok{$FTPCMD};
if($ok !~ /$state/) {