summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorstbuehler <stbuehler@152afb58-edef-0310-8abb-c4023f1b3aa9>2016-03-04 18:54:30 +0000
committerstbuehler <stbuehler@152afb58-edef-0310-8abb-c4023f1b3aa9>2016-03-04 18:54:30 +0000
commita22b126f09c7a75ae6a29149f2209fea7b3c450a (patch)
tree068ec53b155390dfe3bc5a1c3f43a683083b1d6c
parent29fbd50a3d0bf2fdf1e6f16dc109274d1102a526 (diff)
downloadlighttpd-a22b126f09c7a75ae6a29149f2209fea7b3c450a.tar.gz
[mod_cgi] kill CGI if fail to write request body
(clean up potential zombie processes from unreaped children) From: Glenn Strauss <gstrauss@gluelogic.com> git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@3092 152afb58-edef-0310-8abb-c4023f1b3aa9
-rw-r--r--NEWS1
-rw-r--r--src/mod_cgi.c2
2 files changed, 3 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index 6d7ac16d..e0e2ed80 100644
--- a/NEWS
+++ b/NEWS
@@ -22,6 +22,7 @@ NEWS
* [mod_cgi] send 500 if CGI ends and there is no response (fixes #2542)
* [mod_cgi] consolidate CGI cleanup code
* [mod_cgi] simplify mod_cgi_handle_subrequest()
+ * [mod_cgi] kill CGI if fail to write request body
- 1.4.39 - 2016-01-02
* [core] fix memset_s call (fixes #2698)
diff --git a/src/mod_cgi.c b/src/mod_cgi.c
index 78af02ba..d3e02975 100644
--- a/src/mod_cgi.c
+++ b/src/mod_cgi.c
@@ -1153,6 +1153,8 @@ static int cgi_create_env(server *srv, connection *con, plugin_data *p, buffer *
/* fatal error */
close(from_cgi_fds[0]);
close(to_cgi_fds[1]);
+ kill(pid, SIGTERM);
+ cgi_pid_add(srv, p, pid);
return -1;
case -2:
/* connection reset */