asyn-thread: do not allocate thread_data separately

Put the full struct into Curl_async since it will be used for every name
resolve anyway.

Closes #16241
This commit is contained in:
Daniel Stenberg 2025-02-06 16:05:56 +01:00
parent 48f6bfa8c7
commit d9fc64d3ab
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
5 changed files with 188 additions and 208 deletions

View file

@ -49,7 +49,6 @@ struct thread_sync_data {
#ifdef HAVE_GETADDRINFO
struct addrinfo hints;
#endif
struct thread_data *td; /* for thread-self cleanup */
int port;
int sock_error;
bool done;
@ -64,6 +63,7 @@ struct thread_data {
struct Curl_https_rrinfo hinfo;
ares_channel channel;
#endif
bool init;
};
#elif defined(CURLRES_ARES) /* CURLRES_THREADED */
@ -79,7 +79,7 @@ struct thread_data {
#ifdef USE_HTTPSRR
struct Curl_https_rrinfo hinfo;
#endif
char hostname[1];
char *hostname;
};
#endif /* CURLRES_ARES */