summaryrefslogtreecommitdiff
path: root/lib/connect.h
diff options
context:
space:
mode:
authorBjörn Stenberg <bjorn@haxx.se>2013-10-29 11:51:25 +0100
committerDaniel Stenberg <daniel@haxx.se>2013-11-04 22:38:19 +0100
commit02fbc26d59c59170fd358034b04a43d8e9b7c78f (patch)
tree99f9688582ca5abdb78dbb8fb2c065bd9a6d2f97 /lib/connect.h
parent0074c9f5d12e84ed877647e78fcf77460a9270e5 (diff)
downloadcurl-02fbc26d59c59170fd358034b04a43d8e9b7c78f.tar.gz
connect: Add connection delay to Happy Eyeballs.
This patch adds a 200ms delay between the first and second address family socket connection attempts. It also iterates over IP addresses in the order returned by the system, meaning most dual-stack systems will try IPv6 first. Additionally, it refactors the connect code, removing most code that handled synchronous connects. Since all sockets are now non-blocking, the logic can be made simpler.
Diffstat (limited to 'lib/connect.h')
-rw-r--r--lib/connect.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/connect.h b/lib/connect.h
index 526ce37a0..925163941 100644
--- a/lib/connect.h
+++ b/lib/connect.h
@@ -31,9 +31,7 @@ CURLcode Curl_is_connected(struct connectdata *conn,
bool *connected);
CURLcode Curl_connecthost(struct connectdata *conn,
- const struct Curl_dns_entry *host, /* connect to
- this */
- bool *connected); /* truly connected? */
+ const struct Curl_dns_entry *host);
/* generic function that returns how much time there's left to run, according
to the timeouts set */
@@ -42,6 +40,8 @@ long Curl_timeleft(struct SessionHandle *data,
bool duringconnect);
#define DEFAULT_CONNECT_TIMEOUT 300000 /* milliseconds == five minutes */
+#define HAPPY_EYEBALLS_TIMEOUT 200 /* milliseconds to wait between
+ ipv4/ipv6 connection attempts */
/*
* Used to extract socket and connectdata struct for the most recent