about summary refs log tree commit homepage
diff options
context:
space:
mode:
-rwxr-xr-xt/t0021-sendfile-wrap-to_path.sh47
-rwxr-xr-xt/t0031-close-pipe-response.sh47
2 files changed, 86 insertions, 8 deletions
diff --git a/t/t0021-sendfile-wrap-to_path.sh b/t/t0021-sendfile-wrap-to_path.sh
index 6baa890..7f3acaa 100755
--- a/t/t0021-sendfile-wrap-to_path.sh
+++ b/t/t0021-sendfile-wrap-to_path.sh
@@ -9,7 +9,7 @@ ruby) ;;
         ;;
 esac
 
-t_plan 10 "sendfile wrap body response for $model"
+t_plan 16 "sendfile wrap body response for $model"
 
 t_begin "setup and startup" && {
         rtmpfiles out err http_fifo sub_ok
@@ -42,11 +42,50 @@ t_begin "body.close called" && {
         grep CLOSING $out || die "body.close not logged"
 }
 
-t_begin "start FIFO reader for abortive request" && {
+t_begin "start FIFO reader for abortive HTTP/1.1 request" && {
         cat $fifo > $out &
 }
 
-t_begin "send abortive request" && {
+t_begin "send abortive HTTP/1.1 request" && {
+        rm -f $ok
+        (
+                printf 'GET /random_blob HTTP/1.1\r\nHost: example.com\r\n\r\n'
+                dd bs=4096 count=1 < $http_fifo >/dev/null
+                echo ok > $ok
+        ) | socat - TCP:$listen > $http_fifo || :
+        test xok = x$(cat $ok)
+}
+
+t_begin "body.close called for aborted HTTP/1.1 request" && {
+        wait # for cat $fifo
+        grep CLOSING $out || die "body.close not logged"
+}
+
+t_begin "start FIFO reader for abortive HTTP/1.0 request" && {
+        cat $fifo > $out &
+}
+
+t_begin "send abortive HTTP/1.0 request" && {
+        rm -f $ok
+        (
+                printf 'GET /random_blob HTTP/1.0\r\n\r\n'
+                dd bs=4096 count=1 < $http_fifo >/dev/null
+                echo ok > $ok
+        ) | socat - TCP:$listen > $http_fifo || :
+        test xok = x$(cat $ok)
+}
+
+t_begin "body.close called for aborted HTTP/1.0 request" && {
+        wait # for cat $fifo
+        grep CLOSING $out || die "body.close not logged"
+}
+
+t_begin "start FIFO reader for abortive HTTP/0.9 request" && {
+        cat $fifo > $out &
+}
+
+t_begin "send abortive HTTP/0.9 request" && {
+        rm -f $ok
         (
                 printf 'GET /random_blob\r\n'
                 dd bs=4096 count=1 < $http_fifo >/dev/null
@@ -55,7 +94,7 @@ t_begin "send abortive request" && {
         test xok = x$(cat $ok)
 }
 
-t_begin "body.close called for aborted request" && {
+t_begin "body.close called for aborted HTTP/0.9 request" && {
         wait # for cat $fifo
         grep CLOSING $out || die "body.close not logged"
 }
diff --git a/t/t0031-close-pipe-response.sh b/t/t0031-close-pipe-response.sh
index 58b6346..c863d4a 100755
--- a/t/t0031-close-pipe-response.sh
+++ b/t/t0031-close-pipe-response.sh
@@ -1,7 +1,7 @@
 #!/bin/sh
 . ./test-lib.sh
 
-t_plan 10 "close pipe response for $model"
+t_plan 16 "close pipe response for $model"
 
 t_begin "setup and startup" && {
         rtmpfiles err out http_fifo sub_ok
@@ -30,11 +30,50 @@ t_begin "body.close called" && {
         grep CLOSING $out || die "body.close not logged"
 }
 
-t_begin "start FIFO reader for abortive request" && {
+t_begin "start FIFO reader for abortive HTTP/1.1 request" && {
         cat $fifo > $out &
 }
 
-t_begin "send abortive request" && {
+t_begin "send abortive HTTP/1.1 request" && {
+        rm -f $ok
+        (
+                printf 'GET /random_blob HTTP/1.1\r\nHost: example.com\r\n\r\n'
+                dd bs=4096 count=1 < $http_fifo >/dev/null
+                echo ok > $ok
+        ) | socat - TCP:$listen > $http_fifo || :
+        test xok = x$(cat $ok)
+}
+
+t_begin "body.close called for aborted HTTP/1.1 request" && {
+        wait # for cat $fifo
+        grep CLOSING $out || die "body.close not logged"
+}
+
+t_begin "start FIFO reader for abortive HTTP/1.0 request" && {
+        cat $fifo > $out &
+}
+
+t_begin "send abortive HTTP/1.0 request" && {
+        rm -f $ok
+        (
+                printf 'GET /random_blob HTTP/1.0\r\n\r\n'
+                dd bs=4096 count=1 < $http_fifo >/dev/null
+                echo ok > $ok
+        ) | socat - TCP:$listen > $http_fifo || :
+        test xok = x$(cat $ok)
+}
+
+t_begin "body.close called for aborted HTTP/1.0 request" && {
+        wait # for cat $fifo
+        grep CLOSING $out || die "body.close not logged"
+}
+
+t_begin "start FIFO reader for abortive HTTP/0.9 request" && {
+        cat $fifo > $out &
+}
+
+t_begin "send abortive HTTP/0.9 request" && {
+        rm -f $ok
         (
                 printf 'GET /random_blob\r\n'
                 dd bs=4096 count=1 < $http_fifo >/dev/null
@@ -43,7 +82,7 @@ t_begin "send abortive request" && {
         test xok = x$(cat $ok)
 }
 
-t_begin "body.close called for aborted request" && {
+t_begin "body.close called for aborted HTTP/0.9 request" && {
         wait # for cat $fifo
         grep CLOSING $out || die "body.close not logged"
 }