asyn-ares: resolver timeout follows the c-ares mechanism#12703
asyn-ares: resolver timeout follows the c-ares mechanism#12703sunlin7 wants to merge 1 commit intocurl:masterfrom
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-aresfrom commit:a181b4a,
actually
c-aresused default timeout to 2s sincec-ares-1.20.0release (also mentioned on prevous commit).c-ares/c-ares#542
and the timeout=2 from curl will overwrite the
option: timeoutfrom 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.