mirror of
https://github.com/curl/curl.git
synced 2026-08-25 13:43:31 +03:00
asyn-ares: set hint flags when calling ares_getaddrinfo
The hint flag is ARES_AI_NUMERICSERV, and it will save a call to getservbyname or getservbyname_r to set it. Closes #9694
This commit is contained in:
parent
66313cf4b3
commit
e71a9b488f
2 changed files with 6 additions and 1 deletions
|
|
@ -786,6 +786,10 @@ struct Curl_addrinfo *Curl_resolver_getaddrinfo(struct Curl_easy *data,
|
|||
hints.ai_family = pf;
|
||||
hints.ai_socktype = (data->conn->transport == TRNSPRT_TCP)?
|
||||
SOCK_STREAM : SOCK_DGRAM;
|
||||
/* Since the service is a numerical one, set the hint flags
|
||||
* accordingly to save a call to getservbyname in inside C-Ares
|
||||
*/
|
||||
hints.ai_flags = ARES_AI_NUMERICSERV;
|
||||
msnprintf(service, sizeof(service), "%d", port);
|
||||
res->num_pending = 1;
|
||||
ares_getaddrinfo((ares_channel)data->state.async.resolver, hostname,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue