diff options
author | Brian Prodoehl <bprodoehl@connectify.me> | 2016-07-15 11:53:13 -0400 |
---|---|---|
committer | Jay Satiro <raysatiro@yahoo.com> | 2016-07-18 02:42:28 -0400 |
commit | c50980807c55f91c2fb2d09f3b6dc0ae69f4cf45 (patch) | |
tree | 5a57de92de505ede7495ae3773aeadbd58c6c5b3 /lib | |
parent | 16fe3f6b0a73fa4e3e1c2298143e11f4fb4d5f6a (diff) |
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
Diffstat (limited to 'lib')
-rw-r--r-- | lib/easy.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/easy.c b/lib/easy.c index 91c1382f8..dc7139f23 100644 --- a/lib/easy.c +++ b/lib/easy.c @@ -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")); |