6 rtmpfiles unicorn_config pid r_err r_out tmp fifo ok
12 cat > $unicorn_config <<EOF
23 rainbows
-D t4000.ru
-c $unicorn_config
27 curl
-sSfv http
://$listen/
29 echo "two requests with keepalive"
30 curl
-sSfv http
://$listen/a http
://$listen/b
> $tmp 2>&1
31 grep 'Re-using existing connection' < $tmp
33 echo "pipelining partial requests"
34 req
='GET / HTTP/1.1\r\nHost: example.com\r\n'
36 printf "$req"'\r\n'"$req"
39 printf 'Connection: close\r\n\r\n'
42 ) | socat
- TCP
:$listen > $fifo
46 test 2 -eq $
(grep '^HTTP/1.1' $tmp |
wc -l)
47 test 2 -eq $
(grep '^HTTP/1.1 200 OK' $tmp |
wc -l)
48 test 1 -eq $
(grep '^Connection: keep-alive' $tmp |
wc -l)
49 test 1 -eq $
(grep '^Connection: close' $tmp |
wc -l)
50 test x
"$(cat $ok)" = xok