Skip to content

Commit

Permalink
[package] uhttpd: finish inherited uloop in forked childs, fixes misd…
Browse files Browse the repository at this point in the history
…ispatched events leading to race conditions and bad memory accesses

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@32419 3c298f89-4303-0410-b956-a3cf2f4a3e73
  • Loading branch information
jow committed Jun 18, 2012
1 parent 767678c commit 31767f1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package/uhttpd/Makefile
Expand Up @@ -8,7 +8,7 @@
include $(TOPDIR)/rules.mk

PKG_NAME:=uhttpd
PKG_RELEASE:=35
PKG_RELEASE:=36

PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
PKG_CONFIG_DEPENDS := \
Expand Down
3 changes: 3 additions & 0 deletions package/uhttpd/src/uhttpd-cgi.c
Expand Up @@ -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]);
Expand Down
3 changes: 3 additions & 0 deletions package/uhttpd/src/uhttpd-lua.c
Expand Up @@ -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]);
Expand Down

0 comments on commit 31767f1

Please sign in to comment.