summaryrefslogtreecommitdiffstats
path: root/package/uhttpd/src
diff options
context:
space:
mode:
authorjow <jow@3c298f89-4303-0410-b956-a3cf2f4a3e73>2012-06-18 00:41:43 +0000
committerjow <jow@3c298f89-4303-0410-b956-a3cf2f4a3e73>2012-06-18 00:41:43 +0000
commit31767f1683b70f7f58c9e4aa08d1cfae167c9d71 (patch)
tree365dfc7640dab674eadb79e04569ee00438db113 /package/uhttpd/src
parent767678c987452df83bad8cd0af0074da956dd3b9 (diff)
[package] uhttpd: finish inherited uloop in forked childs, fixes misdispatched events leading to race conditions and bad memory accesses
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@32419 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/uhttpd/src')
-rw-r--r--package/uhttpd/src/uhttpd-cgi.c3
-rw-r--r--package/uhttpd/src/uhttpd-lua.c3
2 files changed, 6 insertions, 0 deletions
diff --git a/package/uhttpd/src/uhttpd-cgi.c b/package/uhttpd/src/uhttpd-cgi.c
index ee1b80cc7..8336a1b71 100644
--- a/package/uhttpd/src/uhttpd-cgi.c
+++ b/package/uhttpd/src/uhttpd-cgi.c
@@ -365,6 +365,9 @@ bool uh_cgi_request(struct client *cl, struct path_info *pi,
sleep(atoi(getenv("UHTTPD_SLEEP_ON_FORK") ?: "0"));
#endif
+ /* do not leak parent epoll descriptor */
+ uloop_done();
+
/* close loose pipe ends */
close(rfd[0]);
close(wfd[1]);
diff --git a/package/uhttpd/src/uhttpd-lua.c b/package/uhttpd/src/uhttpd-lua.c
index 0b91b348f..5158534e2 100644
--- a/package/uhttpd/src/uhttpd-lua.c
+++ b/package/uhttpd/src/uhttpd-lua.c
@@ -397,6 +397,9 @@ bool uh_lua_request(struct client *cl, lua_State *L)
sleep(atoi(getenv("UHTTPD_SLEEP_ON_FORK") ?: "0"));
#endif
+ /* do not leak parent epoll descriptor */
+ uloop_done();
+
/* close loose pipe ends */
close(rfd[0]);
close(wfd[1]);