diff --git a/eris.c b/eris.c index 1b38f10..434fcb2 100644 --- a/eris.c +++ b/eris.c @@ -98,7 +98,6 @@ char *path; int http_version; char *content_type; size_t content_length; -int header_sent; off_t range_start, range_end; time_t ims = 0; @@ -144,7 +143,6 @@ dolog(int code, off_t len) void header(unsigned int code, const char *httpcomment) { - header_sent = 1; printf("HTTP/1.%d %u %s\r\n", http_version, code, httpcomment); printf("Server: " FNORD "\r\n"); printf("Connection: %s\r\n", keepalive?"keep-alive":"close"); @@ -521,7 +519,6 @@ handle_request() range_end = 0; content_type = NULL; content_length = 0; - header_sent = 0; alarm(READTIMEOUT); @@ -749,14 +746,6 @@ handle_request() return; } -void -sigalarm(int sig) -{ - if (! header_sent) { - badrequest(408, "Request Timeout", "You are being too slow."); - } -} - int main(int argc, char *argv[], const char *const *envp) { @@ -767,7 +756,6 @@ main(int argc, char *argv[], const char *const *envp) setbuffer(stdout, stdout_buf, sizeof stdout_buf); signal(SIGPIPE, SIG_IGN); - signal(SIGALRM, sigalarm); get_ucspi_env(); while (1) { diff --git a/test.sh b/test.sh index a57318d..254c77d 100755 --- a/test.sh +++ b/test.sh @@ -193,7 +193,7 @@ printf 'GET /mongo.cgi HTTP/1.0\r\n\r\n' | $HTTPD_CGI 2>/dev/null | grep -q jame H "Timeouts" title "Read timeout" -(sleep 2.1; echo) | $HTTPD 2>&1 | grep -c 'HTTP/1.. 408 \|.null. 408' | grep -q 2 && pass || fail +(sleep 2.1; printf 'GET / HTTP/1.0\r\n\r\n') | $HTTPD 2>/dev/null | grep -q '.' && fail || pass