aboutsummaryrefslogtreecommitdiff
path: root/tests/httpserver.pl
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2000-11-13 11:45:41 +0000
committerDaniel Stenberg <daniel@haxx.se>2000-11-13 11:45:41 +0000
commit1cc8af277989d01a9538cbbb75b3ddf6f9855aee (patch)
tree2eb416a5115997f553a4bec4073f97a64913c6aa /tests/httpserver.pl
parentbfb118e42ae0785de1106938d3566039e801b925 (diff)
if the server is already running when the script is started, it now verifies
that it actually is our test server that runs
Diffstat (limited to 'tests/httpserver.pl')
-rwxr-xr-xtests/httpserver.pl50
1 files changed, 29 insertions, 21 deletions
diff --git a/tests/httpserver.pl b/tests/httpserver.pl
index 86ca02fa6..3d6938513 100755
--- a/tests/httpserver.pl
+++ b/tests/httpserver.pl
@@ -80,31 +80,39 @@ for ( $waitedpid = 0;
}
}
- #
- # we always start the path with a number, this is the
- # test number that this server will use to know what
- # contents to pass back to the client
- #
- if($path =~ /.*\/(\d*)/) {
- $testnum=$1;
- }
- else {
- print STDERR "UKNOWN TEST CASE\n";
+ if($path =~ /verifiedserver/) {
+ # this is a hard-coded query-string for the test script
+ # to verify that this is the server actually running!
+ print "HTTP/1.1 999 WE ROOLZ\r\n";
exit;
}
- open(INPUT, ">log/server.input");
- for(@headers) {
- print INPUT $_;
- }
- close(INPUT);
+ else {
- # send a reply to the client
- open(DATA, "<data/reply$testnum.txt");
- while(<DATA>) {
- print $_;
+ #
+ # we always start the path with a number, this is the
+ # test number that this server will use to know what
+ # contents to pass back to the client
+ #
+ if($path =~ /.*\/(\d*)/) {
+ $testnum=$1;
+ }
+ else {
+ print STDERR "UKNOWN TEST CASE\n";
+ exit;
+ }
+ open(INPUT, ">log/server.input");
+ for(@headers) {
+ print INPUT $_;
+ }
+ close(INPUT);
+
+ # send a reply to the client
+ open(DATA, "<data/reply$testnum.txt");
+ while(<DATA>) {
+ print $_;
+ }
+ close(DATA);
}
- close(DATA);
-
# print "Hello there, $name, it's now ", scalar localtime, "\r\n";
};
}