1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-21 23:58:49 -05:00
Go to file
Jay Satiro 059b3a5770 connect: Fix happy eyeballs logic for IPv4-only builds
Bug: https://github.com/bagder/curl/pull/168

(trynextip)
- Don't try the "other" protocol family unless IPv6 is available. In an
IPv4-only build the other family can only be IPv6 which is unavailable.

This change essentially stops IPv4-only builds from attempting the
"happy eyeballs" secondary parallel connection that is supposed to be
used by the "other" address family.

Prior to this change in IPv4-only builds that secondary parallel
connection attempt could be erroneously used by the same family (IPv4)
which caused a bug where every address after the first for a host could
be tried twice, often in parallel. This change fixes that bug. An
example of the bug is shown below.

Assume MTEST resolves to 3 addresses 127.0.0.2, 127.0.0.3 and 127.0.0.4:

* STATE: INIT => CONNECT handle 0x64f4b0; line 1046 (connection #-5000)
* Rebuilt URL to: http://MTEST/
* Added connection 0. The cache now contains 1 members
* STATE: CONNECT => WAITRESOLVE handle 0x64f4b0; line 1083
(connection #0)
*   Trying 127.0.0.2...
* STATE: WAITRESOLVE => WAITCONNECT handle 0x64f4b0; line 1163
(connection #0)
*   Trying 127.0.0.3...
* connect to 127.0.0.2 port 80 failed: Connection refused
*   Trying 127.0.0.3...
* connect to 127.0.0.3 port 80 failed: Connection refused
*   Trying 127.0.0.4...
* connect to 127.0.0.3 port 80 failed: Connection refused
*   Trying 127.0.0.4...
* connect to 127.0.0.4 port 80 failed: Connection refused
* connect to 127.0.0.4 port 80 failed: Connection refused
* Failed to connect to MTEST port 80: Connection refused
* Closing connection 0
* The cache now contains 0 members
* Expire cleared
curl: (7) Failed to connect to MTEST port 80: Connection refused

The bug was born in commit bagder/curl@2d435c7.
2015-03-16 12:07:59 +01:00
CMake CMake: fix winsock2 detection on windows 2015-02-19 20:11:04 +01:00
docs mksymbolsmanpage.pl: use std header and generate better nroff header 2015-03-15 23:23:20 +01:00
include mprintf.h: remove #ifdef CURLDEBUG 2015-03-03 12:36:18 +01:00
lib connect: Fix happy eyeballs logic for IPv4-only builds 2015-03-16 12:07:59 +01:00
m4 Enable poll on darwin13 2014-05-06 08:31:10 +02:00
packages openssl: remove all uses of USE_SSLEAY 2015-03-05 10:57:52 +01:00
perl removed trailing whitespace 2011-12-30 03:36:18 +01:00
projects openssl: Removed use of USE_SSLEAY from the Visual Studio project files 2015-03-05 20:47:14 +00:00
src metalink: add some error checks 2015-03-06 23:14:25 +01:00
tests http2: detect prematures close without data transfered 2015-03-14 18:19:51 +01:00
winbuild openssl: remove all uses of USE_SSLEAY 2015-03-05 10:57:52 +01:00
.gitattributes Tell git to not convert configure-related files. 2012-07-17 20:35:23 +02:00
.gitignore Revert "repository: ignore patch files generated by git" 2014-11-24 15:03:16 +01:00
.travis.yml .travis.yml: Change CI make test to make test-full 2015-03-10 20:37:17 +01:00
acinclude.m4 gtls: add support for CURLOPT_CAPATH 2015-03-10 15:03:54 +01:00
buildconf buildconf: update copyright year 2014-11-04 19:53:44 +01:00
buildconf.bat curl tool: renaming hugehelp files to tool_hugehelp 2012-12-26 23:30:54 +01:00
CHANGES CHANGES: move all contents from CHANGES to CHANGES.0 2010-06-21 22:27:39 +02:00
CHANGES.0 code/docs: Use correct case for IPv4 and IPv6 2014-12-27 11:31:55 +00:00
CMakeLists.txt openssl: remove all uses of USE_SSLEAY 2015-03-05 10:57:52 +01:00
configure.ac configure: follow-up fix from 709cf76f6 2015-03-05 15:43:38 +01:00
CONTRIBUTING.md CONTRIBUTING.md: file for advice on github 2015-03-03 00:38:41 +01:00
contributors.sh contributors.sh: --releasenotes reads in names from RELEASE-NOTES 2014-11-06 11:03:06 +01:00
COPYING COPYING: Bumped copyright year to 2015 2015-01-01 05:14:38 +00:00
CTestConfig.cmake ENH: move dashboard location 2009-07-15 19:40:46 +00:00
curl-config.in curl-config.in: eliminate double quotes around CURL_CA_BUNDLE 2015-02-25 10:23:07 +01:00
GIT-INFO curl tool: renaming hugehelp files to tool_hugehelp 2012-12-26 23:30:54 +01:00
install-sh Remove all traces of FBOpenSSL SPNEGO support 2014-07-16 17:26:08 +02:00
libcurl.pc.in build: prevent global LIBS from influencing src and lib build targets 2012-12-03 22:41:18 +01:00
log2changes.pl log2changes.pl: fix the Version output 2012-06-07 23:50:00 +02:00
MacOSX-Framework MacOSX-Framework: use @rpath instead of @executable_path 2015-03-09 23:39:27 +01:00
Makefile.am Makefile.am: fix 'make distcheck' 2015-02-02 23:11:44 +01:00
Makefile.dist VC build: added sspi define for winssl-zlib builds. 2014-12-09 13:30:28 +01:00
maketgz newlines: fix mixed newlines to LF-only 2014-09-12 10:22:34 +02:00
missing renamed generated config.h to curl_config.h in order to avoid clashes when libcurl is used with other projects which also have a config.h. 2009-07-14 13:25:14 +00:00
mkinstalldirs Remove all traces of FBOpenSSL SPNEGO support 2014-07-16 17:26:08 +02:00
README various changes of CVS to git 2010-03-22 00:34:09 +01:00
RELEASE-NOTES RELEASE-NOTES: synced with 186e46d88d 2015-03-12 23:40:38 +01:00

                                  _   _ ____  _
                              ___| | | |  _ \| |
                             / __| | | | |_) | |
                            | (__| |_| |  _ <| |___
                             \___|\___/|_| \_\_____|

README

  Curl is a command line tool for transferring data specified with URL
  syntax. Find out how to use curl by reading the curl.1 man page or the
  MANUAL document. Find out how to install Curl by reading the INSTALL
  document.

  libcurl is the library curl is using to do its job. It is readily
  available to be used by your software. Read the libcurl.3 man page to
  learn how!

  You find answers to the most frequent questions we get in the FAQ document.

  Study the COPYING file for distribution terms and similar. If you distribute
  curl binaries or other binaries that involve libcurl, you might enjoy the
  LICENSE-MIXING document.

CONTACT

  If you have problems, questions, ideas or suggestions, please contact us
  by posting to a suitable mailing list. See http://curl.haxx.se/mail/

  All contributors to the project are listed in the THANKS document.

WEB SITE

  Visit the curl web site for the latest news and downloads:

        http://curl.haxx.se/

GIT

  To download the very latest source off the GIT server do this:

    git clone git://github.com/bagder/curl.git

  (you'll get a directory named curl created, filled with the source code)

NOTICE

  Curl contains pieces of source code that is Copyright (c) 1998, 1999
  Kungliga Tekniska Högskolan. This notice is included here to comply with the
  distribution terms.