connect: fix builds without AF_INET6

Regression from 2b309560c1

Reviewed-by: Daniel Stenberg
Reviewed-by: Jay Satiro

Closes #9770
This commit is contained in:
Viktor Szakats 2022-10-20 09:09:36 +00:00
Родитель 1943fe14be
Коммит 3dc8f6f255
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5ABD165E2AEF201
1 изменённых файлов: 8 добавлений и 5 удалений

Просмотреть файл

@ -1197,6 +1197,7 @@ static CURLcode singleipconnect(struct Curl_easy *data,
#ifdef TCP_FASTOPEN_CONNECT #ifdef TCP_FASTOPEN_CONNECT
int optval = 1; int optval = 1;
#endif #endif
const char *ipmsg;
char buffer[STRERROR_LEN]; char buffer[STRERROR_LEN];
curl_socket_t *sockp = &conn->tempsock[tempindex]; curl_socket_t *sockp = &conn->tempsock[tempindex];
*sockp = CURL_SOCKET_BAD; *sockp = CURL_SOCKET_BAD;
@ -1214,11 +1215,13 @@ static CURLcode singleipconnect(struct Curl_easy *data,
Curl_closesocket(data, conn, sockfd); Curl_closesocket(data, conn, sockfd);
return CURLE_OK; return CURLE_OK;
} }
infof(data, " Trying %s%s%s:%d...", #ifdef ENABLE_IPV6
(addr.family == AF_INET6 ? "[" : ""), if(addr.family == AF_INET6)
ipaddress, ipmsg = " Trying [%s]:%d...";
(addr.family == AF_INET6 ? "]" : ""), else
port); #endif
ipmsg = " Trying %s:%d...";
infof(data, ipmsg, ipaddress, port);
#ifdef ENABLE_IPV6 #ifdef ENABLE_IPV6
is_tcp = (addr.family == AF_INET || addr.family == AF_INET6) && is_tcp = (addr.family == AF_INET || addr.family == AF_INET6) &&