1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-09 00:00:04 +01:00

ensure accept is nonblocking

Signed-off-by: Andy Green <andy.green@linaro.org>
This commit is contained in:
Andy Green 2013-01-28 11:23:52 +08:00
parent 52f28ce67a
commit 6f047eea6c

View file

@ -222,6 +222,9 @@ int lws_server_socket_service(struct libwebsocket_context *context,
setsockopt(accept_fd, IPPROTO_TCP, TCP_NODELAY,
(const void *)&opt, sizeof(opt));
/* We are nonblocking... */
fcntl(accept_fd, F_SETFL, O_NONBLOCK);
/*
* look at who we connected to and give user code a chance
* to reject based on client IP. There's no protocol selected