summary refs log tree commit diff
path: root/listen.c
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2019-10-23 17:16:04 -0400
committerJune McEnroe <june@causal.agency>2019-10-23 17:16:04 -0400
commit64eeda05604fe8a039699de8bee2b677a683ab33 (patch)
treeff8afc7c3ba975cb7b5601ac994684f03758a373 /listen.c
parentClean up state.c and factor out parsing (diff)
downloadpounce-64eeda05604fe8a039699de8bee2b677a683ab33.tar.gz
pounce-64eeda05604fe8a039699de8bee2b677a683ab33.zip
Set clients non-blocking
Diffstat (limited to 'listen.c')
-rw-r--r--listen.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/listen.c b/listen.c
index 1179a8b..2d83462 100644
--- a/listen.c
+++ b/listen.c
@@ -15,6 +15,7 @@
  */
 
 #include <err.h>
+#include <fcntl.h>
 #include <netdb.h>
 #include <netinet/in.h>
 #include <stdlib.h>
@@ -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));
ass='nohover-highlight'> Surprisingly seems to work for everything I looked at in my repos. 2021-01-20Add all target to git.causal.agency MakefileJune McEnroe 2021-01-20Remove Lua supportJune McEnroe Lua support is unused and the dlsym fwrite/write hacks horrify me. Clean it up. 2021-01-20Fix tests for diff spansJune McEnroe 2021-01-20Avoid matching ':' in make tagsJune McEnroe Otherwise a :: rule includes one of the ':'s in the tag name. 2021-01-19Prefer tag matches not preceded by [[:alnum:]]June McEnroe Otherwise the "id" in "void" matches for "void id". 2021-01-19Escape \ and / in mtags search patternsJune McEnroe 2021-01-20Use mtags in source-filterJune McEnroe 2021-01-19Add mtags to generate tags for make and mdocJune McEnroe 2021-01-19Map tags to IDs using only [[:alnum:]-._]June McEnroe 2021-01-19Don't use a pager if reading standard inputJune McEnroe 2021-01-19Support BSD make syntax and match *.amJune McEnroe These don't really go together, but... 2021-01-19Match tab following escaped newline in make assignmentsJune McEnroe Otherwise it ends up going into Shell state. 2021-01-18Allow matching lexers using first input lineJune McEnroe