From dbd16c3e256c6ce872829d1654785485361a0a78 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 12 Mar 2020 14:03:26 +0100 Subject: connect: happy eyeballs cleanup Make sure each separate index in connn->tempaddr[] is used for a fixed family (and only that family) during the connection process. If family one takes a long time and family two fails immediately, the previous logic could misbehave and retry the same family two address repeatedly. Reported-by: Paul Vixie Reported-by: Jay Satiro Fixes #5083 Fixes #4954 Closes #5089 --- lib/urldata.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/urldata.h') diff --git a/lib/urldata.h b/lib/urldata.h index fbb8b645e..4ee568fd6 100644 --- a/lib/urldata.h +++ b/lib/urldata.h @@ -957,6 +957,7 @@ struct connectdata { 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 */ + int tempfamily[2]; /* family used for the temp sockets */ Curl_recv *recv[2]; Curl_send *send[2]; @@ -1113,6 +1114,8 @@ struct connectdata { handle */ BIT(sock_accepted); /* TRUE if the SECONDARYSOCKET was created with accept() */ + BIT(parallel_connect); /* set TRUE when a parallel connect attempt has + started (happy eyeballs) */ }; /* The end of connectdata. */ -- cgit v1.2.3