aboutsummaryrefslogtreecommitdiff
path: root/lib/url.c
diff options
context:
space:
mode:
authorBjörn Stenberg <bjorn@haxx.se>2013-10-26 14:17:33 +0200
committerDaniel Stenberg <daniel@haxx.se>2013-10-27 11:19:53 +0100
commit7d7df831981feebdbfeb21c12d6c068312a6e4b6 (patch)
tree0f9020e62bfbc3fa74b2d7a9200f03cf5fe4e1ae /lib/url.c
parent7de4cc35f81aa6c3cdb8b377a27843bcabdaec48 (diff)
Add "Happy Eyeballs" for IPv4/IPv6.
This patch invokes two socket connect()s nearly simultaneously, and the socket that is first connected "wins" and is subsequently used for the connection. The other is terminated. There is a very slight IPv4 preference, in that if both sockets connect simultaneously IPv4 is checked first and thus will win.
Diffstat (limited to 'lib/url.c')
-rw-r--r--lib/url.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/lib/url.c b/lib/url.c
index 9973bd273..e86fbc252 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -3260,7 +3260,6 @@ static CURLcode ConnectPlease(struct SessionHandle *data,
bool *connected)
{
CURLcode result;
- Curl_addrinfo *addr;
#ifndef CURL_DISABLE_VERBOSE_STRINGS
char *hostname = conn->bits.proxy?conn->proxy.name:conn->host.name;
@@ -3276,13 +3275,8 @@ static CURLcode ConnectPlease(struct SessionHandle *data,
*************************************************************/
result= Curl_connecthost(conn,
conn->dns_entry,
- &conn->sock[FIRSTSOCKET],
- &addr,
connected);
if(CURLE_OK == result) {
- /* All is cool, we store the current information */
- conn->ip_addr = addr;
-
if(*connected) {
result = Curl_connected_proxy(conn, FIRSTSOCKET);
if(!result) {
@@ -5643,8 +5637,8 @@ CURLcode Curl_setup_conn(struct connectdata *conn,
Curl_pgrsTime(data, TIMER_APPCONNECT); /* we're connected already */
conn->bits.tcpconnect[FIRSTSOCKET] = TRUE;
*protocol_done = TRUE;
- Curl_verboseconnect(conn);
Curl_updateconninfo(conn, conn->sock[FIRSTSOCKET]);
+ Curl_verboseconnect(conn);
}
/* Stop the loop now */
break;