5 rtmpfiles pid tmp ok fifo
10 rainbows
-D t0000.ru
-l $listen --pid $pid &
14 curl
-sSfv http
://$listen/
16 echo "two requests with keepalive"
17 curl
-sSfv http
://$listen/a http
://$listen/b
> $tmp 2>&1
18 grep 'Re-using existing connection' < $tmp
20 echo "pipelining partial requests"
21 req
='GET / HTTP/1.1\r\nHost: foo\r\n'
23 printf "$req"'\r\n'"$req"
26 printf 'Connection: close\r\n\r\n'
28 ) | socat
- TCP
:$listen > $fifo
32 # sed -ne 's/^/------/p' < $tmp
33 test 2 -eq $
(grep '^HTTP/1.1' $tmp |
wc -l)
34 test 2 -eq $
(grep '^HTTP/1.1 200 OK' $tmp |
wc -l)
35 test 1 -eq $
(grep '^Connection: keep-alive' $tmp |
wc -l)
36 test 1 -eq $
(grep '^Connection: close' $tmp |
wc -l)
37 test x
"$(cat $ok)" = xok