From 64eeda05604fe8a039699de8bee2b677a683ab33 Mon Sep 17 00:00:00 2001 From: Curtis McEnroe Date: Wed, 23 Oct 2019 17:16:04 -0400 Subject: Set clients non-blocking --- listen.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'listen.c') diff --git a/listen.c b/listen.c index 1179a8b..2d83462 100644 --- a/listen.c +++ b/listen.c @@ -15,6 +15,7 @@ */ #include +#include #include #include #include @@ -80,6 +81,7 @@ size_t listenBind(int fds[], size_t cap, const char *host, const char *port) { int listenAccept(struct tls **client, int fd) { int sock = accept(fd, NULL, NULL); if (sock < 0) err(EX_IOERR, "accept"); + fcntl(sock, F_SETFL, O_NONBLOCK); int yes = 1; int error = setsockopt(sock, SOL_SOCKET, SO_NOSIGPIPE, &yes, sizeof(yes)); -- cgit 1.4.1