diff options
author | Björn Stenberg <bjorn@haxx.se> | 2013-10-26 14:17:33 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2013-10-27 11:19:53 +0100 |
commit | 7d7df831981feebdbfeb21c12d6c068312a6e4b6 (patch) | |
tree | 0f9020e62bfbc3fa74b2d7a9200f03cf5fe4e1ae /lib/ftp.c | |
parent | 7de4cc35f81aa6c3cdb8b377a27843bcabdaec48 (diff) | |
download | curl-7d7df831981feebdbfeb21c12d6c068312a6e4b6.tar.gz |
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/ftp.c')
-rw-r--r-- | lib/ftp.c | 5 |
1 files changed, 1 insertions, 4 deletions
@@ -1881,7 +1881,6 @@ static CURLcode ftp_state_pasv_resp(struct connectdata *conn, struct ftp_conn *ftpc = &conn->proto.ftpc; CURLcode result; struct SessionHandle *data=conn->data; - Curl_addrinfo *conninfo; struct Curl_dns_entry *addr=NULL; int rc; unsigned short connectport; /* the local port connect() should use! */ @@ -2041,8 +2040,6 @@ static CURLcode ftp_state_pasv_resp(struct connectdata *conn, result = Curl_connecthost(conn, addr, - &conn->sock[SECONDARYSOCKET], - &conninfo, &connected); Curl_resolv_unlock(data, addr); /* we're done using this address */ @@ -2064,7 +2061,7 @@ static CURLcode ftp_state_pasv_resp(struct connectdata *conn, if(data->set.verbose) /* this just dumps information about this second connection */ - ftp_pasv_verbose(conn, conninfo, ftpc->newhost, connectport); + ftp_pasv_verbose(conn, conn->ip_addr, ftpc->newhost, connectport); if(connected) { /* Only do the proxy connection magic if we're actually connected. We do |