diff options
author | jow <jow@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2012-06-02 14:56:24 +0000 |
---|---|---|
committer | jow <jow@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2012-06-02 14:56:24 +0000 |
commit | f76b15292874aa4ce5f175831d7b6fcba1f4eaf2 (patch) | |
tree | 8a89e27cddbc2918d3473c665190d36e748bbb22 /package/uhttpd/src | |
parent | 35d604e71319886e686cbb66a7afb62d5a300c3d (diff) |
[package] uhttpd: add explicit stdin eof notification for Lua and CGI childs
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@32027 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/uhttpd/src')
-rw-r--r-- | package/uhttpd/src/uhttpd-cgi.c | 4 | ||||
-rw-r--r-- | package/uhttpd/src/uhttpd-lua.c | 6 |
2 files changed, 9 insertions, 1 deletions
diff --git a/package/uhttpd/src/uhttpd-cgi.c b/package/uhttpd/src/uhttpd-cgi.c index 2f7ea7afa..5e445ca37 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 */ diff --git a/package/uhttpd/src/uhttpd-lua.c b/package/uhttpd/src/uhttpd-lua.c index 7d602f7c5..e8d932b47 100644 --- a/package/uhttpd/src/uhttpd-lua.c +++ b/package/uhttpd/src/uhttpd-lua.c @@ -298,9 +298,13 @@ static bool uh_lua_socket_cb(struct client *cl) else state->content_length = 0; - /* ... write to CGI process */ + /* ... write to Lua 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 */ |