aboutsummaryrefslogtreecommitdiff
path: root/tests/httpserver.pl
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2000-11-13 19:58:40 +0000
committerDaniel Stenberg <daniel@haxx.se>2000-11-13 19:58:40 +0000
commit3cd77a19ca22e6f0c40a73e5fe1b40c42150bdfe (patch)
treeb5a8c7ae95ac373870fc75c6051940512ac5edf6 /tests/httpserver.pl
parente02affb5d097301903680c7b9b2b0cc6ee330ad9 (diff)
basic and early ftp support
Diffstat (limited to 'tests/httpserver.pl')
-rwxr-xr-xtests/httpserver.pl32
1 files changed, 30 insertions, 2 deletions
diff --git a/tests/httpserver.pl b/tests/httpserver.pl
index 6ece59630..453fe710e 100755
--- a/tests/httpserver.pl
+++ b/tests/httpserver.pl
@@ -40,6 +40,15 @@ sub REAPER {
logmsg "reaped $waitedpid" . ($? ? " with exit $?" : '');
}
+$commandok{ USER => 'fresh'}; # USER is ok in fresh state
+
+print "TEST: ".$commandok{"USER"}."\n";
+
+
+$statechange{ 'USER' => 'passwd'}; # USER goes to passwd state
+
+$displaytext{'USER' => '331 We are happy you arrived!'}; # output FTP line
+
$SIG{CHLD} = \&REAPER;
for ( $waitedpid = 0;
@@ -74,11 +83,14 @@ for ( $waitedpid = 0;
# < 150 ASCII data connection for /bin/ls (193.15.23.1,59196) (0 bytes).
# * Getting file with size: -1
+ # flush data:
+ $| = 1;
+
print "220-running the curl suite test server\r\n",
"220-running the curl suite test server\r\n",
"220 running the curl suite test server\r\n";
- STDOUT->autoflush(1);
+ $state="fresh";
while(1) {
@@ -93,8 +105,24 @@ for ( $waitedpid = 0;
"badly formed command received: ".$_;
exit 0;
}
+ $FTPCMD=$1;
+ $full=$_;
- print STDERR "GOT: $_\n";
+ print STDERR "GOT: ($1) $_\n";
+
+ $ok = $commandok{$FTPCMD};
+ if($ok !~ /$state/) {
+ print "314 $FTPCMD not OK ($ok) in state: $state!\r\n";
+ exit;
+ }
+
+ $state=$statechange{$FTPCMD};
+ if($command{$1} eq "") {
+ print "314 Wwwwweeeeird internal error\r\n";
+ exit
+ }
+ $text = $displaytext{$FTPCMD};
+ print "$text\r\n";
}
exit;
}