[core] set one-shot mode fd O_NONBLOCK, FD_CLOEXEC

(thx citaylor)

x-ref:
  https://redmine.lighttpd.net/boards/2/topics/7487
personal/stbuehler/mod-csrf
Glenn Strauss 2017-07-29 00:18:48 -04:00
parent 07e57e24c2
commit c23f8fdd6f
1 changed files with 3 additions and 0 deletions

View File

@ -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);
}