[core] fix fd leak when using libev (fixes #2761)
commiteb37615a47de85a53909225706cb9240652c704a
authorGlenn Strauss <gstrauss@gluelogic.com>
Wed, 26 Oct 2016 20:28:25 +0000 (26 16:28 -0400)
committerGlenn Strauss <gstrauss@gluelogic.com>
Sat, 29 Oct 2016 13:13:49 +0000 (29 09:13 -0400)
tree5d99d74f7df56cfd0bf7d71fe3e5c862ff4d6acb
parent86c68ecbc7e8f10551fefd5b97b2345f2ed571b2
[core] fix fd leak when using libev (fixes #2761)

server.event-handler = "libev" would leak fds after the change made
in commit:40f16d5 since fdevent_libev.c:fdevent_libev_poll() always
returned 0 ready events after handling the event callbacks itself.
Therefore, fdevent_libev.c:fdevent_libev_poll() must also call
fdevent_sched_run() to handled fds scheduled to be closed.

This bug was introduced in 1.4.42.

(thx mittwinter for troubleshooting and identifying problem)

Note: server.event-handler = "libev" is no longer recommended.
lighttpd provides event handlers optimized for modern systems for most
platforms, and the limited way that lighttpd uses libev does not provide
any advantages over the OS-specific optimized event handlers.

x-ref:
  "fd leak with libev in 1.4.42"
  https://redmine.lighttpd.net/issues/2761
src/fdevent_libev.c