From 2cf72776d89f96eb6184b084992894c86a62cd00 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Sat, 2 Jun 2012 14:56:24 +0000 Subject: uhttpd: add explicit stdin eof notification for Lua and CGI childs SVN-Revision: 32027 --- package/uhttpd/src/uhttpd-cgi.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'package/uhttpd/src/uhttpd-cgi.c') diff --git a/package/uhttpd/src/uhttpd-cgi.c b/package/uhttpd/src/uhttpd-cgi.c index 2f7ea7afaa..5e445ca372 100644 --- a/package/uhttpd/src/uhttpd-cgi.c +++ b/package/uhttpd/src/uhttpd-cgi.c @@ -181,6 +181,10 @@ static bool uh_cgi_socket_cb(struct client *cl) /* ... write to CGI process */ len = uh_raw_send(state->wfd, buf, len, cl->server->conf->script_timeout); + + /* explicit EOF notification for the child */ + if (state->content_length <= 0) + close(state->wfd); } /* try to read data from child */ -- cgit v1.2.3