-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add the Miou implementation of happy-eyeballs #41
Conversation
I added a new patch which takes the advantages of |
96d94bc
to
4ff9ff8
Compare
Actually,
|
I re-implemented |
d7fb602
to
d885406
Compare
Ok, we are done on this side. I checked that we don't have a file-descriptor leak. The |
CHANGES: * Add the miou implementation of happy-eyeballs (@dinosaure, @hannesm, robur-coop/happy-eyeballs#41) * Fix the CirrusCI (@hannesm, robur-coop/happy-eyeballs#43)
CHANGES: * Add the miou implementation of happy-eyeballs (@dinosaure, @hannesm, robur-coop/happy-eyeballs#41) * Fix the CirrusCI (@hannesm, robur-coop/happy-eyeballs#43)
CHANGES: * Add the miou implementation of happy-eyeballs (@dinosaure, @hannesm, robur-coop/happy-eyeballs#41) * Fix the CirrusCI (@hannesm, robur-coop/happy-eyeballs#43)
This implementation provide an
happy-eyeballs
implementation with Miou with the idea proposed in #38 (with a protection to avoid to inject multiple a time a DNS resolver). This implementation is able to provide what is needed fordns-client
then and handle UDP, TCP and TLS DNS resolution (the last one withtls-miou
available here mirleft/ocaml-tls#494).I tested the implementation with httpcats and see if I was able to resolve domain-names with UDP, TCP and TLS. Minor some timeout on
uncensoreddns
(used for TLS), everything seems to work.The idea of this implementation is to launch a task in parallel which will care about its internal state and how to connect sockets to a given IP address. The daemon tries multiple connections and take the first one connected - other sub-tasks are cancelled and their file-descriptors are properly closed. The daemon works with a internal queue which aggregate user's actions and events from sub-tasks (when a socket is connected, we fill this queue with such event). The daemon can be suspended a certain amount of times (when
happy-eyeballs
returns`Act
) or suspended as long as nothing (user's actions or events) appears (whenhappy-eyeballs
returns`Suspend
). Finally, the transfer of the file-descriptor is done via an atomic value. The user initiate a busy-loop and receive an error (if thehappy-eyeballs
say so) or the socket connected.A documentation was written to explain the purpose of
inject_resolver
and to precise that the user must kill the daemon at the end of the process.