3 # add current source dir to the include-path
4 # we need this for make distcheck
5 (my $srcdir = $0) =~ s
,/[^/]+$,/,;
11 use Test
::More tests
=> 7;
14 my $tf = LightyTest
->new();
17 ok
($tf->start_proc == 0, "Starting lighttpd") or die();
19 $t->{REQUEST
} = ( <<EOF
20 GET /12345.txt HTTP/1.0
21 Connection: keep-alive
24 GET /12345.txt HTTP/1.0
29 $t->{RESPONSE
} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } , { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ];
31 ok
($tf->handle_http($t) == 0, 'Explicit HTTP/1.0 Keep-Alive');
35 $t->{REQUEST
} = ( <<EOF
36 GET /12345.txt HTTP/1.0
37 Connection: keep-alive
40 GET /12345.txt HTTP/1.0
45 $t->{RESPONSE
} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } , { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ];
47 ok
($tf->handle_http($t) == 0, 'Explicit HTTP/1.0 Keep-Alive');
51 $t->{REQUEST
} = ( <<EOF
52 GET /12345.txt HTTP/1.0
53 Connection: keep-alive
56 GET /12345.txt HTTP/1.0
60 $t->{RESPONSE
} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } , { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ];
61 ok
($tf->handle_http($t) == 0, 'Implicit HTTP/1.0 Keep-Alive');
64 $t->{REQUEST
} = ( <<EOF
65 GET /12345.txt HTTP/1.1
66 Connection: keep-alive
69 GET /12345.txt HTTP/1.1
74 $t->{RESPONSE
} = [ { 'HTTP-Protocol' => 'HTTP/1.1', 'HTTP-Status' => 200 } , { 'HTTP-Protocol' => 'HTTP/1.1', 'HTTP-Status' => 200 } ];
75 ok
($tf->handle_http($t) == 0, 'Explicit HTTP/1.1 Keep-Alive');
77 $t->{REQUEST
} = ( <<EOF
78 GET /12345.txt HTTP/1.1
81 GET /12345.txt HTTP/1.1
87 $t->{RESPONSE
} = [ { 'HTTP-Protocol' => 'HTTP/1.1', 'HTTP-Status' => 200 } , { 'HTTP-Protocol' => 'HTTP/1.1', 'HTTP-Status' => 200 } ];
89 ok
($tf->handle_http($t) == 0, 'Implicit HTTP/1.1 Keep-Alive');
91 ok
($tf->stop_proc == 0, "Stopping lighttpd");