From c765ccc1ad632546b5fb44103cdfbb446eaf7d4a Mon Sep 17 00:00:00 2001 From: Vesa Karvonen Date: Tue, 10 Sep 2024 20:39:31 +0300 Subject: [PATCH] Work around Uri not being thread safe See [issue in Uri](https://github.com/mirage/ocaml-uri/issues/178). --- lib/picos_io_cohttp/picos_io_cohttp.ml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/picos_io_cohttp/picos_io_cohttp.ml b/lib/picos_io_cohttp/picos_io_cohttp.ml index 1122fe78..3d73ee88 100644 --- a/lib/picos_io_cohttp/picos_io_cohttp.ml +++ b/lib/picos_io_cohttp/picos_io_cohttp.ml @@ -312,3 +312,8 @@ module Server = struct in accept () end + +let () = + (* Try to work around Uri not being thread safe *) + Uri.of_string "http://[::::1]:8080" |> ignore; + Uri.of_string "http://localhost:8080/" |> ignore