P2P: ignore spurious SIGPIPE signals

This commit is contained in:
Benjamin Canou 2017-12-04 15:46:26 +01:00
parent 0967c7fde7
commit 9cb50f01b2

View File

@ -9,6 +9,14 @@
(* TODO decide whether we need to preallocate buffers or not. *) (* TODO decide whether we need to preallocate buffers or not. *)
let () =
(* Otherwise some writes trigger a SIGPIPE instead of raising an
Lwt_unit exception. In the node, this is already done by
Cohttp, so this is only useful when using the P2P layer as a
stand alone library. *)
if Sys.os_type <> "Win32" then
Sys.(set_signal sigpipe Signal_ignore)
open P2p_types open P2p_types
include Logging.Make (struct let name = "p2p.io-scheduler" end) include Logging.Make (struct let name = "p2p.io-scheduler" end)