From 041d1e14d66916b7701991646ac88cf1f90a0cda Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 10 Jan 2014 08:37:43 +0100 Subject: threaded-resolver: never use NULL hints with getaddrinfo The net effect of this bug as it appeared to users, would be that libcurl would timeout in the connect phase. When disabling IPv6 use but still using getaddrinfo, libcurl would wrongly not init the "hints" struct field in init_thread_sync() which would subsequently lead to a getaddrinfo() invoke with a zeroed hints with ai_socktype set to 0 instead of SOCK_STREAM. This would lead to different behaviors on different platforms but basically incorrect output. This code was introduced in 483ff1ca75cbea, released in curl 7.20.0. This bug became a problem now due to the happy eyeballs code and how libcurl now traverses the getaddrinfo() results differently. Bug: http://curl.haxx.se/mail/lib-2014-01/0061.html Reported-by: Fabian Frank Debugged-by: Fabian Frank --- lib/asyn-thread.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/asyn-thread.c b/lib/asyn-thread.c index 4882c3720..c72c06431 100644 --- a/lib/asyn-thread.c +++ b/lib/asyn-thread.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2013, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2014, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -209,7 +209,7 @@ int init_thread_sync_data(struct thread_sync_data * tsd, memset(tsd, 0, sizeof(*tsd)); tsd->port = port; -#ifdef CURLRES_IPV6 +#ifdef HAVE_GETADDRINFO DEBUGASSERT(hints); tsd->hints = *hints; #else -- cgit v1.2.3