openbsd-ports/www/lighttpd/patches/patch-src_mod_cgi_c
jasper bfe8448a3a - Handle EINTR in mod_cgi during write()
- Fix mod_magnet to set con->mode = p->id if it generates content,
  so returning 4xx/5xx doesn't append an error page

from brad@
2008-04-25 10:23:07 +00:00

35 lines
1.0 KiB
Plaintext

$OpenBSD: patch-src_mod_cgi_c,v 1.1 2008/04/25 10:23:07 jasper Exp $
--- src/mod_cgi.c.orig Thu Apr 24 01:17:35 2008
+++ src/mod_cgi.c Thu Apr 24 01:19:08 2008
@@ -1058,8 +1058,9 @@ static int cgi_create_env(server *srv, connection *con
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
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
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);