Add support for getaddrinfo#278
Add support for getaddrinfo#278talex5 merged 1 commit intoocaml-multicore:mainfrom bikallem:getaddrinfo
Conversation
|
@talex5 do you know if the |
talex5
left a comment
There was a problem hiding this comment.
Thanks! This looks reasonable to me.
I think we should call this getaddrinfo rather than addrinfo though, as that's the name everyone uses for it (including OCaml's Unix module). Also, it may access the network so the getting part is quite important.
do you know if the ocaml-ci has ipv6 enabled? or how to enable it? The test for this PR seems to be failing as I expect Ipv6 address but the machine is not returning any.
What gets returned for localhost will depend on the system configuration, so it's probably best to test it using numeric addresses.
|
@talex5 I have renamed |
|
One thing possibly worth mentioning is that users may wish to override this method to point to a non-libc implementation (especially on Alpine, where musl's Supporting this use case isn't a problem (capabilities make this very easy to do), but I do feel a bit weird about calling this function |
talex5
left a comment
There was a problem hiding this comment.
Either getaddrinfo or resolve_addr is fine with me. I don't think there's any problem with getaddrinfo calling an alternative implementation as long as it does roughly the same thing. Otherwise we'd have to rename everything else too (e.g. unlink and mkdir might not be calling the glibc function either, if it's a remote directory, or a directory inside a zip archive).
talex5
left a comment
There was a problem hiding this comment.
Looks good to me! I added one test for port numbers and squash-rebased it on main.
CHANGES: New features: - Add `Eio.Condition` (@TheLortex @talex5 ocaml-multicore/eio#277). Allows a fiber to wait for some condition to become true. - Add `Eio.Net.getaddrinfo` and `getnameinfo` (@bikallem @talex5 ocaml-multicore/eio#278 ocaml-multicore/eio#288 ocaml-multicore/eio#291). Convert between host names and addresses. - Add `Eio.Debug` (@talex5 ocaml-multicore/eio#276). Currently, this allows overriding the `traceln` function. - `Buf_write.create`: make switch optional (@talex5 ocaml-multicore/eio#283). This makes things easier for people porting code from Faraday. Bug fixes: - Allow sharing of libuv poll handles (@patricoferris @talex5 ocaml-multicore/eio#279). Luv doesn't allow two callers to watch the same file handle, so we need to handle that in Eio. Other changes: - Upgrade to uring 0.4 (@talex5 ocaml-multicore/eio#290). - Mention `Mutex`, `Semaphore` and `Condition` in the README (@talex5 ocaml-multicore/eio#281).
Fixes part of #258