From 3764e6bfe73507819db9c06ff5130a72e2d762ad Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Sat, 16 Dec 2023 10:39:49 +0000 Subject: With a selfpipe, the socket needs to be nb, duh Signed-off-by: Laurent Bercot --- src/server/shibari-server-tcp.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/server/shibari-server-tcp.c b/src/server/shibari-server-tcp.c index ea93978..94d0ccd 100644 --- a/src/server/shibari-server-tcp.c +++ b/src/server/shibari-server-tcp.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -176,6 +177,8 @@ int main (int argc, char const *const *argv) if (!cdb_init(&tdb, tdbfile)) strerr_diefu2sys(111, "open DNS database file ", tdbfile) ; } + if (ndelay_on(0) == -1 || ndelay_on(1) == -1) + strerr_diefu1sys(111, "set socket nonblocking") ; if (!sig_altignore(SIGPIPE)) strerr_diefu1sys(111, "ignore SIGPIPE") ; tain_now_set_stopwatch_g() ; shibari_log_start(verbosity, &remoteip, remoteport) ; -- cgit 1.4.1