curl_global_init: Check if IPv6 works

- Curl_ipv6works() is not thread-safe until after the first call, so
call it once during global init to avoid a possible race condition.

Bug: https://github.com/curl/curl/issues/915
PR: https://github.com/curl/curl/pull/918
This commit is contained in:
Brian Prodoehl 2016-07-15 11:53:13 -04:00 committed by Jay Satiro
parent 16fe3f6b0a
commit c50980807c
1 changed files with 2 additions and 0 deletions

View File

@ -271,6 +271,8 @@ static CURLcode global_init(long flags, bool memoryfuncs)
return CURLE_FAILED_INIT;
}
(void)Curl_ipv6works();
#if defined(USE_LIBSSH2) && defined(HAVE_LIBSSH2_INIT)
if(libssh2_init(0)) {
DEBUGF(fprintf(stderr, "Error: libssh2_init failed\n"));