aboutsummaryrefslogtreecommitdiff
path: root/lib/urldata.h
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/urldata.h
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/urldata.h')
-rw-r--r--lib/urldata.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/urldata.h b/lib/urldata.h
index ebaaf6ff4..98686bb33 100644
--- a/lib/urldata.h
+++ b/lib/urldata.h
@@ -838,6 +838,7 @@ struct connectdata {
within the DNS cache, so this pointer is only valid as long as the DNS
cache entry remains locked. It gets unlocked in Curl_done() */
Curl_addrinfo *ip_addr;
+ Curl_addrinfo *tempaddr[2]; /* for happy eyeballs */
/* 'ip_addr_str' is the ip_addr data as a human readable string.
It remains available as long as the connection does, which is longer than
@@ -889,6 +890,7 @@ struct connectdata {
struct timeval created; /* creation time */
curl_socket_t sock[2]; /* two sockets, the second is used for the data
transfer when doing FTP */
+ curl_socket_t tempsock[2]; /* temporary sockets for happy eyeballs */
bool sock_accepted[2]; /* TRUE if the socket on this index was created with
accept() */
Curl_recv *recv[2];