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
asyn-ares: resolver timeout follows the c-ares mechanism #12703
Conversation
Why? It risks/makes the timeouts to be different with different c-ares versions. Why do curl users want that? Also, this patch checks the version of c--ares used when building curl, not the version that is actually used in run-time. That might not be the same... |
curl failed example (curl 8.4+, c-ares 1.24+):
It's already there: curl-8.3 with c-ares the DNS timeout is 5 seconds; while curl-8.4 with c-ares timeout is 2 seconds. I like to change curl to get the version from loaded libcares dynamicly, give me minutes. |
655cc3c
to
c3ac2ed
Compare
Hi @bagder |
I did not even know that thing existed. This then begs the question: what if we want to set the limit to N seconds but allow /etc/resolv.conf to override if set. Is that then not possible, you know? |
Hi @bagder
Currently no grace way to do that (unless we parse the /etc/resolv.conf, but that's not curl's scope.) |
thanks! |
Thank you ! |
Hi,
The curl should set c-ares's timeout only for
c-ares
<1.20.0
.curl use a fixed timeout=2s for
c-ares
from commit:a181b4a,
actually
c-ares
used default timeout to 2s sincec-ares-1.20.0
release (also mentioned on prevous commit).c-ares/c-ares#542
and the timeout=2 from curl will overwrite the
option: timeout
from the/etc/resolv.conf
, which supported sincec-ares-1.23.0
:https://github.com/c-ares/c-ares/pull/632/files
So setting c-ares timeout to 2s should only apply to old c-ares < 1.20.0, won't overwrite timeout for c-ares > 1.23.0.