From 5868eeecb2fbc85f3e4fabf3d16f27d259491c0d Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 26 Nov 2009 14:09:45 -0800 Subject: cleanup and refactor error handling Make sure app errors get logged correctly, and we no longer return a 500 response when a client EOFs the write end (but not the read end) of a connection. --- t/t0001-unix-http.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 't/t0001-unix-http.sh') diff --git a/t/t0001-unix-http.sh b/t/t0001-unix-http.sh index 59f996a..e9bc919 100755 --- a/t/t0001-unix-http.sh +++ b/t/t0001-unix-http.sh @@ -1,6 +1,6 @@ #!/bin/sh . ./test-lib.sh -t_plan 18 "simple HTTP connection keepalive/pipelining tests for $model" +t_plan 19 "simple HTTP connection keepalive/pipelining tests for $model" t_begin "checking for config.ru for $model" && { tbase=simple-http_$model.ru @@ -23,6 +23,17 @@ t_begin "single TCP request" && { curl -sSfv http://$listen/ } +t_begin "handles client EOF gracefully" && { + printf 'GET / HTTP/1.1\r\nHost: example.com\r\n\r\n' | \ + socat - UNIX:$unix_socket > $tmp + dbgcat tmp + if grep 'HTTP.* 500' $tmp + then + die "500 error returned on client shutdown(SHUT_WR)" + fi + check_stderr +} + dbgcat r_err t_begin "pipelining partial requests" && { -- cgit v1.2.3-24-ge0c7