connect: store IPv6 connection status after valid connection

... previously it would store it already in the happy eyeballs stage
which could lead to the IPv6 bit being set for an IPv4 connection,
leading to curl not wanting to do EPSV=>PASV for FTP transfers.

Closes #2053
This commit is contained in:
Daniel Stenberg 2017-11-04 13:32:14 +01:00
parent 63b8fbbbc0
commit 6b12beb25a
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2
1 changed files with 3 additions and 4 deletions

View File

@ -785,6 +785,9 @@ CURLcode Curl_is_connected(struct connectdata *conn,
conn->sock[sockindex] = conn->tempsock[i];
conn->ip_addr = conn->tempaddr[i];
conn->tempsock[i] = CURL_SOCKET_BAD;
#ifdef ENABLE_IPV6
conn->bits.ipv6 = (conn->ip_addr->ai_family == AF_INET6)?TRUE:FALSE;
#endif
/* close the other socket, if open */
if(conn->tempsock[other] != CURL_SOCKET_BAD) {
@ -1097,10 +1100,6 @@ static CURLcode singleipconnect(struct connectdata *conn,
return CURLE_OK;
}
#ifdef ENABLE_IPV6
conn->bits.ipv6 = (addr.family == AF_INET6)?TRUE:FALSE;
#endif
if(-1 == rc) {
switch(error) {
case EINPROGRESS: