From 1562a19a021a72a78ba495328d2d37ba0dc83b8c Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Tue, 7 Dec 2010 12:11:51 -0800 Subject: rev+revactor: fix LARGE pipelined uploads Large uploads behave differently with regard to buffering, and there were bugs in the way the Rev and Revactor backends handled uploads. --- t/t0106-rack-input-keepalive.sh | 48 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 47 insertions(+), 1 deletion(-) (limited to 't/t0106-rack-input-keepalive.sh') diff --git a/t/t0106-rack-input-keepalive.sh b/t/t0106-rack-input-keepalive.sh index c4a531d..ce6d092 100755 --- a/t/t0106-rack-input-keepalive.sh +++ b/t/t0106-rack-input-keepalive.sh @@ -1,6 +1,6 @@ #!/bin/sh . ./test-lib.sh -t_plan 7 "rack.input pipelining test" +t_plan 11 "rack.input pipelining test" t_begin "setup and startup" && { rainbows_setup $model @@ -9,9 +9,55 @@ t_begin "setup and startup" && { body=hello body_size=$(printf $body | wc -c) body_sha1=$(printf $body | rsha1) + random_blob_size=$(wc -c < random_blob) + random_blob_sha1=$(rsha1 < random_blob) rainbows_wait_start } +t_begin "send big pipelined chunked requests" && { + ( + cat $fifo > $tmp & + content-md5-put < random_blob + content-md5-put < random_blob + content-md5-put < random_blob + printf 'PUT / HTTP/1.0\r\n' + printf 'Content-Length: %d\r\n\r\n' $random_blob_size + cat random_blob + wait + echo ok > $ok + ) | socat - TCP4:$listen > $fifo + test x"$(cat $ok)" = xok +} + +t_begin "check responses" && { + dbgcat tmp + test 4 -eq $(grep $random_blob_sha1 $tmp | wc -l) +} + +t_begin "send big pipelined identity requests" && { + ( + cat $fifo > $tmp & + printf 'PUT / HTTP/1.0\r\n' + printf 'Connection: keep-alive\r\n' + printf 'Content-Length: %d\r\n\r\n' $random_blob_size + cat random_blob + printf 'PUT / HTTP/1.1\r\n' + printf 'Content-Length: %d\r\n\r\n' $random_blob_size + cat random_blob + printf 'PUT / HTTP/1.0\r\n' + printf 'Content-Length: %d\r\n\r\n' $random_blob_size + cat random_blob + wait + echo ok > $ok + ) | socat - TCP4:$listen > $fifo + test x"$(cat $ok)" = xok +} + +t_begin "check responses" && { + dbgcat tmp + test 3 -eq $(grep $random_blob_sha1 $tmp | wc -l) +} + t_begin "send pipelined identity requests" && { { -- cgit v1.2.3-24-ge0c7