]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
curl_global_init: Check if IPv6 works 921/head
authorBrian Prodoehl <bprodoehl@connectify.me>
Fri, 15 Jul 2016 15:53:13 +0000 (11:53 -0400)
committerJay Satiro <raysatiro@yahoo.com>
Mon, 18 Jul 2016 06:42:28 +0000 (02:42 -0400)
- 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

index 91c1382f8eaab5354da69e9073b172cef8007a74..dc7139f232628f35bfbdd97569280a73fbdd65a6 100644 (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"));