summaryrefslogtreecommitdiff
path: root/src/server
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2023-12-16 10:39:49 +0000
committerLaurent Bercot <ska@appnovation.com>2023-12-16 10:39:49 +0000
commit3764e6bfe73507819db9c06ff5130a72e2d762ad (patch)
tree67cfb4131cf26cc532790fac4cce0c07978c1ace /src/server
parentc2debf6a725a4e7dc5abee3cb6196f0b3b8463fa (diff)
downloadshibari-3764e6bfe73507819db9c06ff5130a72e2d762ad.tar.xz
With a selfpipe, the socket needs to be nb, duh
Signed-off-by: Laurent Bercot <ska@appnovation.com>
Diffstat (limited to 'src/server')
-rw-r--r--src/server/shibari-server-tcp.c3
1 files changed, 3 insertions, 0 deletions
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 <skalibs/sgetopt.h>
#include <skalibs/sig.h>
#include <skalibs/tai.h>
+#include <skalibs/djbunix.h>
#include <skalibs/ip46.h>
#include <skalibs/cdb.h>
#include <skalibs/unix-timed.h>
@@ -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) ;