output the protocol data to stderr when verbose is on

This commit is contained in:
Daniel Stenberg 2001-03-12 12:44:44 +00:00
parent 639a7982ba
commit c576e114b9

View File

@ -63,6 +63,8 @@ for ( $waitedpid = 0;
my ($request, $path, $ver, $left, $cl); my ($request, $path, $ver, $left, $cl);
my @headers; my @headers;
stdin:
while(<STDIN>) { while(<STDIN>) {
if($_ =~ /([A-Z]*) (.*) HTTP\/1.(\d)/) { if($_ =~ /([A-Z]*) (.*) HTTP\/1.(\d)/) {
$request=$1; $request=$1;
@ -135,13 +137,16 @@ for ( $waitedpid = 0;
print "HTTP/1.1 200 OK\r\n", print "HTTP/1.1 200 OK\r\n",
"header: yes\r\n", "header: yes\r\n",
"\r\n", "\r\n",
"You must select a test number to get good data back\r\n"; "You must enter a test number to get good data back\r\n";
} }
else { else {
# send a custom reply to the client # send a custom reply to the client
open(DATA, "<data/reply$testnum.txt"); open(DATA, "<data/reply$testnum.txt");
while(<DATA>) { while(<DATA>) {
print $_; print $_;
if($verbose) {
print STDERR "OUT: $_";
}
} }
close(DATA); close(DATA);
} }