From c50980807c55f91c2fb2d09f3b6dc0ae69f4cf45 Mon Sep 17 00:00:00 2001 From: Brian Prodoehl Date: Fri, 15 Jul 2016 11:53:13 -0400 Subject: 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 --- lib/easy.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/easy.c') 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")); -- cgit v1.2.3