mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-09 00:00:04 +01:00
sockets: FD_CLOEXEC
If the user code forks, it inherits open copies of all lws sockets, which conflict if lws later decides to close them.
This commit is contained in:
parent
b49ef8b6d1
commit
dfb4dde763
1 changed files with 2 additions and 0 deletions
|
@ -330,6 +330,8 @@ lws_plat_set_socket_options(struct lws_vhost *vhost, int fd)
|
|||
struct protoent *tcp_proto;
|
||||
#endif
|
||||
|
||||
fcntl(fd, F_SETFD, FD_CLOEXEC);
|
||||
|
||||
if (vhost->ka_time) {
|
||||
/* enable keepalive on this socket */
|
||||
optval = 1;
|
||||
|
|
Loading…
Add table
Reference in a new issue