Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions src/http/http.ml
Original file line number Diff line number Diff line change
Expand Up @@ -687,6 +687,10 @@ let on_termination_signal () =
ignore (Lwt_unix.on_signal Sys.sigint (fun _ -> Lwt.wakeup_later int_resolve ()));
Lwt.pick [term_promise; int_promise]

let ignore_sigpipe () =
if Sys.unix then
Sys.(set_signal sigpipe Signal_ignore)

let network ~port ~socket_path =
match socket_path with
| None -> `Inet port
Expand All @@ -704,6 +708,8 @@ let serve
?(builtins = true)
user's_dream_handler =

ignore_sigpipe ();

serve_with_maybe_https
"serve"
~interface
Expand Down Expand Up @@ -734,9 +740,7 @@ let run
?adjust_terminal
user's_dream_handler =

let () = if Sys.unix then
Sys.(set_signal sigpipe Signal_ignore)
in
ignore_sigpipe ();

let log = Log.convenience_log in

Expand Down
Loading