Set the listening socket non-blocking before we accept() on it.
authorEmil Mikulic <emikulic@gmail.com>
Sun, 8 Jul 2012 11:41:10 +0000 (21:41 +1000)
committerEmil Mikulic <emikulic@gmail.com>
Tue, 6 Aug 2013 08:31:08 +0000 (18:31 +1000)
This has not come up as a problem before, but it's a good idea.

http.c

diff --git a/http.c b/http.c
index add1031..b8744e5 100644 (file)
--- a/http.c
+++ b/http.c
@@ -931,6 +931,8 @@ static void http_listen_one(struct addrinfo *ai,
         return;
     }
 
+    fd_set_nonblock(sockin);
+
     /* reuse address */
     sockopt = 1;
     if (setsockopt(sockin, SOL_SOCKET, SO_REUSEADDR,