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);