rev*: avoid hung connections when proxying HTTP/0.9
[rainbows.git] / t / t0104-rack-input-limit-tiny.sh
blob0cf9f736c7151330d29e153208f9cdbeda5e0f70
1 #!/bin/sh
2 . ./test-lib.sh
3 test -r random_blob || die "random_blob required, run with 'make $0'"
4 req_curl_chunked_upload_err_check
6 t_plan 6 "rack.input client_max_body_size tiny"
8 t_begin "setup and startup" && {
9 rtmpfiles curl_out curl_err cmbs_config
10 rainbows_setup $model
11 sed -e 's/client_max_body_size.*/client_max_body_size 256/' \
12 < $unicorn_config > $cmbs_config
13 rainbows -D sha1-random-size.ru -c $cmbs_config
14 rainbows_wait_start
17 t_begin "stops a regular request" && {
18 rm -f $ok
19 dd if=/dev/zero bs=257 count=1 of=$tmp
20 curl -vsSf -T $tmp -H Expect: \
21 http://$listen/ > $curl_out 2> $curl_err || > $ok
22 dbgcat curl_err
23 dbgcat curl_out
24 test -e $ok
27 t_begin "stops a large chunked request" && {
28 rm -f $ok
29 dd if=/dev/zero bs=257 count=1 | \
30 curl -vsSf -T- -H Expect: \
31 http://$listen/ > $curl_out 2> $curl_err || > $ok
32 dbgcat curl_err
33 dbgcat curl_out
34 test -e $ok
37 t_begin "small size sha1 chunked ok" && {
38 blob_sha1=b376885ac8452b6cbf9ced81b1080bfd570d9b91
39 rm -f $ok
40 dd if=/dev/zero bs=256 count=1 | \
41 curl -vsSf -T- -H Expect: \
42 http://$listen/ > $curl_out 2> $curl_err
43 dbgcat curl_err
44 dbgcat curl_out
45 test "$(cat $curl_out)" = $blob_sha1
48 t_begin "small size sha1 content-length ok" && {
49 blob_sha1=b376885ac8452b6cbf9ced81b1080bfd570d9b91
50 rm -f $ok
51 dd if=/dev/zero bs=256 count=1 of=$tmp
52 curl -vsSf -T $tmp -H Expect: \
53 http://$listen/ > $curl_out 2> $curl_err
54 dbgcat curl_err
55 dbgcat curl_out
56 test "$(cat $curl_out)" = $blob_sha1
59 t_begin "shutdown" && {
60 kill $rainbows_pid
63 t_done