summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGlenn Strauss <gstrauss@gluelogic.com>2017-07-29 00:18:48 -0400
committerGlenn Strauss <gstrauss@gluelogic.com>2017-07-29 00:36:35 -0400
commitc23f8fdd6f148e0548926bcd92ec7759f52f872c (patch)
tree37ecc29cff0dc8b49deb70e4abce385a3d242074
parent07e57e24c2201ef80ded0f9625b04213298a736d (diff)
downloadlighttpd1.4-c23f8fdd6f148e0548926bcd92ec7759f52f872c.tar.gz
lighttpd1.4-c23f8fdd6f148e0548926bcd92ec7759f52f872c.zip
[core] set one-shot mode fd O_NONBLOCK, FD_CLOEXEC
(thx citaylor) x-ref: https://redmine.lighttpd.net/boards/2/topics/7487
-rw-r--r--src/server.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/server.c b/src/server.c
index d1f3ac8d..68892eed 100644
--- a/src/server.c
+++ b/src/server.c
@@ -516,6 +516,9 @@ static int server_oneshot_init(server *srv, int fd) {
return 0;
}
+ /*(must set flags; fd did not pass through fdevent accept() logic)*/
+ fdevent_fcntl_set_nb_cloexec(srv->ev, fd);
+
if (cnt_addr.plain.sa_family != AF_UNIX) {
network_accept_tcp_nagle_disable(fd);
}