From 8dd78e06c76ab0b7c711192c25547118372d12bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20B=C3=BChler?= Date: Wed, 23 Apr 2008 15:05:50 +0000 Subject: [PATCH] Handle EINTR in mod_cgi during write() (#1640) git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2153 152afb58-edef-0310-8abb-c4023f1b3aa9 --- NEWS | 1 + src/mod_cgi.c | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 613bfdf3..6525bc39 100644 --- a/NEWS +++ b/NEWS @@ -18,6 +18,7 @@ NEWS * Fix accesslog port (should be port from the connection, not the "server.port") (#1618) * Fix mod_fastcgi prefix matching: match the prefix always against url, not the absolute filepath (regardless of check-local) * Overwrite Content-Type header in mod_dirlisting instead of inserting (#1614), patch by Henrik Holst + * Handle EINTR in mod_cgi during write() (#1640) - 1.4.19 - 2008-03-10 diff --git a/src/mod_cgi.c b/src/mod_cgi.c index 82ae78b6..bccfdd8f 100644 --- a/src/mod_cgi.c +++ b/src/mod_cgi.c @@ -1058,8 +1058,9 @@ static int cgi_create_env(server *srv, connection *con, plugin_data *p, buffer * switch(errno) { case ENOSPC: con->http_status = 507; - break; + case EINTR: + continue; default: con->http_status = 403; break; @@ -1071,8 +1072,9 @@ static int cgi_create_env(server *srv, connection *con, plugin_data *p, buffer * switch(errno) { case ENOSPC: con->http_status = 507; - break; + case EINTR: + continue; default: con->http_status = 403; break; @@ -1087,6 +1089,8 @@ static int cgi_create_env(server *srv, connection *con, plugin_data *p, buffer * c->offset += r; cq->bytes_out += r; } else { + log_error_write(srv, __FILE__, __LINE__, "ss", "write() failed due to: ", strerror(errno)); + con->http_status = 500; break; } chunkqueue_remove_finished_chunks(cq);