From 61fcf3fda7cee754dd4a9d5f65988440f874f236 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Lavergne?= Date: Tue, 8 Aug 2023 14:22:55 -0400 Subject: [PATCH] Clarify why we do SIGINT/SIGHUP shenanigans --- src/Tiny_httpd_server.ml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Tiny_httpd_server.ml b/src/Tiny_httpd_server.ml index e1e460da..1a8993b6 100644 --- a/src/Tiny_httpd_server.ml +++ b/src/Tiny_httpd_server.ml @@ -957,6 +957,8 @@ module Unix_tcp_server_ = struct try let client_sock, _ = Unix.accept sock in Unix.setsockopt client_sock Unix.TCP_NODELAY true; + (* Block INT/HUP while cloning to avoid children handling them. + When thread gets them, our Unix.accept raises neatly. *) ignore Unix.(sigprocmask SIG_BLOCK Sys.[ sigint; sighup ]); self.new_thread (fun () -> try