-
Notifications
You must be signed in to change notification settings - Fork 614
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
ares_getaddrinfo() of port 0 reports ARES_ESERVICE #517
Comments
It turns out c-ares returns an error when asked to resolve a host name with ares_getaddrinfo using port number 0. Reported as a c-ares bug here: c-ares/c-ares#517 The work-around is to simply use port 80 instead, as the number typically does not make a difference and a non-zero number works for c-ares. Fixes #10759 Reported-by: Matt Jolly
It turns out c-ares returns an error when asked to resolve a host name with ares_getaddrinfo using port number 0. Reported as a c-ares bug here: c-ares/c-ares#517 The work-around is to simply use port 80 instead, as the number typically does not make a difference and a non-zero number works for c-ares. Fixes #10759 Reported-by: Matt Jolly Closes #10789
When you say zero, are you passing 0 (aka NULL) as the "service" argument, or are you passing the string "0"? |
The string https://github.com/curl/curl/blob/a51f90ec0f74176776f5d14b99689f9241660eaa/lib/asyn-ares.c#L784 I modified the code to instead use the string |
Interesting use case. Typically if you don't care about the service port in a dns lookup, you'll just pass NULL to that field. But if other implementations support this, we definitely can too, its a trivial change. |
It turns out c-ares returns an error when asked to resolve a host name with ares_getaddrinfo using port number 0. Reported as a c-ares bug here: c-ares/c-ares#517 The work-around is to simply use port 80 instead, as the number typically does not make a difference and a non-zero number works for c-ares. Fixes curl#10759 Reported-by: Matt Jolly Closes curl#10789
... while using glibc's
getaddrinfo()
with the same port number works fine.(I use
ARES_AI_NUMERICSERV
set inai_flags
)Is there actually any good reason to refuse just using 0 as a dummy port?
The text was updated successfully, but these errors were encountered: