aboutsummaryrefslogtreecommitdiff
path: root/tests/ftpserver.pl
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2000-11-21 15:49:34 +0000
committerDaniel Stenberg <daniel@haxx.se>2000-11-21 15:49:34 +0000
commitae58d84429b933fceda1fb48b8cf3c9d17acaae0 (patch)
tree1e5545c9587a79814c2548fe596f36aaa6f92644 /tests/ftpserver.pl
parenteb993c28ca4a9d11e803ce5f82320229c9b6ea6c (diff)
Added support for verifiedserver that returns a static silly string that
allows the test script to verify that it is our test server running on the particular port
Diffstat (limited to 'tests/ftpserver.pl')
-rw-r--r--tests/ftpserver.pl14
1 files changed, 11 insertions, 3 deletions
diff --git a/tests/ftpserver.pl b/tests/ftpserver.pl
index 38eb06af7..08b204ffd 100644
--- a/tests/ftpserver.pl
+++ b/tests/ftpserver.pl
@@ -37,15 +37,13 @@ do {
my $proto = getprotobyname('tcp') || 6;
-my $ftp_sendfile=""; # set to a file name when the file should be sent
-
socket(Server, PF_INET, SOCK_STREAM, $proto)|| die "socket: $!";
setsockopt(Server, SOL_SOCKET, SO_REUSEADDR,
pack("l", 1)) || die "setsockopt: $!";
bind(Server, sockaddr_in($port, INADDR_ANY))|| die "bind: $!";
listen(Server,SOMAXCONN) || die "listen: $!";
-print "FTP server started on port $port\n";
+#print "FTP server started on port $port\n";
open(PID, ">.ftpserver.pid");
print PID $$;
@@ -156,6 +154,16 @@ sub RETR_command {
logmsg "RETR test number $testno\n";
+ if($testno =~ /^verifiedserver$/) {
+ # this is the secret command that verifies that this actually is
+ # the curl test server
+ print "150 Binary junk (10 bytes).\r\n";
+ print SOCK "WE ROOLZ\r\n";
+ close(SOCK);
+ print "226 File transfer complete\r\n";
+ return 0;
+ }
+
my $filename = "data/reply$testno.txt";
my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,