diff options
author | Jan Kneschke <jan@kneschke.de> | 2005-08-31 12:55:44 +0000 |
---|---|---|
committer | Jan Kneschke <jan@kneschke.de> | 2005-08-31 12:55:44 +0000 |
commit | 79886610900e95efcbea3ee73f9f612c7788bbca (patch) | |
tree | b5a2778c47daf99d630675bf8b4d3f8ea40f019e /tests/LightyTest.pm | |
parent | 5c20c426b7e532602613e8796a6f8b55fa31b5ad (diff) | |
download | lighttpd-git-79886610900e95efcbea3ee73f9f612c7788bbca.tar.gz |
added tests for keep-alive and setenv and passed a ARRAY ref instead of a HASH ref
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-merge-1.4.x@654 152afb58-edef-0310-8abb-c4023f1b3aa9
Diffstat (limited to 'tests/LightyTest.pm')
-rwxr-xr-x | tests/LightyTest.pm | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/tests/LightyTest.pm b/tests/LightyTest.pm index e619051b..89272c4f 100755 --- a/tests/LightyTest.pm +++ b/tests/LightyTest.pm @@ -150,7 +150,7 @@ sub handle_http { close $remote; my $href; - foreach $href (@response) { + foreach $href ( @{ $t->{RESPONSE} }) { # first line is always response header my %resp_hdr; my $resp_body; @@ -187,7 +187,13 @@ sub handle_http { # check length if (defined $resp_hdr{"content-length"}) { - ($resp_body, $lines) = split("^.".$resp_hdr{"content-length"}, $lines, 2); + $resp_body = substr($lines, 0, $resp_hdr{"content-length"}); + if (length($lines) < $resp_hdr{"content-length"}) { + $lines = ""; + } else { + $lines = substr($lines, $resp_hdr{"content-length"}); + } + undef $lines if (length($lines) == 0); } else { $resp_body = $lines; undef $lines; |