mirror of
https://github.com/curl/curl.git
synced 2026-04-15 13:31:41 +03:00
if the server is already running when the script is started, it now verifies
that it actually is our test server that runs
This commit is contained in:
parent
bfb118e42a
commit
1cc8af2779
2 changed files with 42 additions and 21 deletions
|
|
@ -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";
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue