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 | 5a69751c30bd1f939dc6bf075b7ce57342ac7f11 (patch) | |
tree | 5485b0e09982b1c1200e195b3f622f50931e5a7a /uhttpd-lua.c | |
parent | 8407669751574909c4814266179b1a7c9f826d93 (diff) | |
download | uhttpd-5a69751c30bd1f939dc6bf075b7ce57342ac7f11.tar.gz |
[package] uhttpd: add explicit stdin eof notification for Lua and CGI childs
git-svn-id: svn://svn.openwrt.org/openwrt/trunk/package/uhttpd/src@32027 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'uhttpd-lua.c')
-rw-r--r-- | uhttpd-lua.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/uhttpd-lua.c b/uhttpd-lua.c index 7d602f7..e8d932b 100644 --- a/uhttpd-lua.c +++ b/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 */ |