Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
toots committed Jan 18, 2025
1 parent 9d1690d commit 400382c
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/core/io/srt_io.ml
Original file line number Diff line number Diff line change
Expand Up @@ -89,25 +89,25 @@ let getaddrinfo ~(log : Log.t) ~prefer_address address port =
match prefer_address with
| `System_default -> first_address
| `Ipv4 ->
let rec f ptr cur =
let rec f ptr =
let sockaddr = !@ptr in
if is_null sockaddr then cur
if is_null sockaddr then first_address
else (
match !@(sockaddr |-> Sockaddr.sa_family) with
| id when id = af_inet -> sockaddr
| _ -> f (ptr +@ 1) cur)
| _ -> f (ptr +@ 1))
in
f ptr first_address
f ptr
| `Ipv6 ->
let rec f ptr cur =
let rec f ptr =
let sockaddr = !@ptr in
if is_null sockaddr then cur
if is_null sockaddr then first_address
else (
match !@(sockaddr |-> Sockaddr.sa_family) with
| id when id = af_inet6 -> sockaddr
| _ -> f (ptr +@ 1) cur)
| _ -> f (ptr +@ 1))
in
f ptr first_address
f ptr
in
if log#active 5 then
log#f 5 "Address %s:%n resolved to: %s" address port
Expand Down

0 comments on commit 400382c

Please sign in to comment.