diff --git a/dune-project b/dune-project index 0386bec..6c9ba31 100644 --- a/dune-project +++ b/dune-project @@ -48,6 +48,6 @@ (unstrctrd (>= 0.2)) (eio_main - (>= "1.0")) + (>= "1.4")) (dune-site :with-test) (alcotest :with-test))) diff --git a/lib/connection.ml b/lib/connection.ml index ae7b8ac..ba0324f 100644 --- a/lib/connection.ml +++ b/lib/connection.ml @@ -47,9 +47,6 @@ let resolve_host = network hostname) with - | [] -> - Error - (`Connect_error (Format.asprintf "Can't resolve hostname: %s" hostname)) | xs -> (match config.Config.prefer_ip_version with | `Both -> @@ -84,6 +81,13 @@ let resolve_host = Error (`Connect_error (Format.asprintf "Timed out resolving hostname: %s" hostname)) + | exception Eio.Io (Eio.Net.E (Eio.Net.Address_lookup_failed code), _) -> + Error + (`Connect_error + (Format.asprintf + "Can't resolve hostname %s: %s" + hostname + (Eio.Net.Getaddrinfo_error.to_message code))) module Info = struct (* This represents information that changes from connection to connection, @@ -168,7 +172,6 @@ let connect ~sw ~clock ~network ~config conn_info = let status = match code with | Eio.Net.Refused _ -> "connection refused" - | No_matching_addresses -> "no matching addresses" | Timeout -> "timeout" in Error diff --git a/piaf.opam b/piaf.opam index 5905271..2bfff9e 100644 --- a/piaf.opam +++ b/piaf.opam @@ -25,7 +25,7 @@ depends: [ "pecu" {>= "0.4"} "prettym" "unstrctrd" {>= "0.2"} - "eio_main" {>= "1.0"} + "eio_main" {>= "1.4"} "dune-site" {with-test} "alcotest" {with-test} "odoc" {with-doc}