Skip to content
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion dune-project
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,6 @@
(unstrctrd
(>= 0.2))
(eio_main
(>= "1.0"))
(>= "1.4"))
(dune-site :with-test)
(alcotest :with-test)))
11 changes: 7 additions & 4 deletions lib/connection.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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 ->
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion piaf.opam
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
Loading