hostip: lazily wait to figure out if IPv6 works until needed

The check may take many milliseconds, so now it is performed once the
value is first needed. Also, this change makes sure that the value is
not used if the resolve is set to be IPv4-only.

Closes #9553
This commit is contained in:
Daniel Stenberg 2022-09-21 08:52:57 +02:00
parent 7295e62c66
commit 46f3fe0e75
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
7 changed files with 17 additions and 13 deletions

View file

@ -417,7 +417,6 @@ struct Curl_multi *Curl_multi_handle(int hashsize, /* socket hash */
/* -1 means it not set by user, use the default value */
multi->maxconnects = -1;
multi->max_concurrent_streams = 100;
multi->ipv6_works = Curl_ipv6works(NULL);
#ifdef USE_WINSOCK
multi->wsa_event = WSACreateEvent();