mirror of
https://github.com/curl/curl.git
synced 2026-08-25 02:33:31 +03:00
hostip: remove conn->data from resolver functions
This also moves the 'async' struct from the connectdata struct into the Curl_easy struct, which seems like a better home for it. Closes #6497
This commit is contained in:
parent
d3a3bdb5ef
commit
8335c6417e
18 changed files with 242 additions and 254 deletions
|
|
@ -127,7 +127,7 @@ static void dump_addrinfo(struct connectdata *conn,
|
|||
* memory we need to free after use. That memory *MUST* be freed with
|
||||
* Curl_freeaddrinfo(), nothing else.
|
||||
*/
|
||||
struct Curl_addrinfo *Curl_getaddrinfo(struct connectdata *conn,
|
||||
struct Curl_addrinfo *Curl_getaddrinfo(struct Curl_easy *data,
|
||||
const char *hostname,
|
||||
int port,
|
||||
int *waitp)
|
||||
|
|
@ -141,14 +141,11 @@ struct Curl_addrinfo *Curl_getaddrinfo(struct connectdata *conn,
|
|||
char addrbuf[128];
|
||||
#endif
|
||||
int pf;
|
||||
#if !defined(CURL_DISABLE_VERBOSE_STRINGS)
|
||||
struct Curl_easy *data = conn->data;
|
||||
#endif
|
||||
|
||||
*waitp = 0; /* synchronous response only */
|
||||
|
||||
/* Check if a limited name resolve has been requested */
|
||||
switch(conn->ip_version) {
|
||||
switch(data->set.ipver) {
|
||||
case CURL_IPRESOLVE_V4:
|
||||
pf = PF_INET;
|
||||
break;
|
||||
|
|
@ -166,7 +163,7 @@ struct Curl_addrinfo *Curl_getaddrinfo(struct connectdata *conn,
|
|||
|
||||
memset(&hints, 0, sizeof(hints));
|
||||
hints.ai_family = pf;
|
||||
hints.ai_socktype = (conn->transport == TRNSPRT_TCP) ?
|
||||
hints.ai_socktype = (data->conn->transport == TRNSPRT_TCP) ?
|
||||
SOCK_STREAM : SOCK_DGRAM;
|
||||
|
||||
#ifndef USE_RESOLVE_ON_IPS
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue