lib/fetch: remove port from happy eyeballs verbose logs, wrong cast and redundant

This commit is contained in:
Duncaen 2019-06-20 13:28:14 +02:00
parent 88e72f9f00
commit 093950dba2

View File

@ -564,10 +564,7 @@ happy_eyeballs_connect(struct addrinfo *res0, int verbose)
char hbuf[1025];
if (getnameinfo(res->ai_addr, res->ai_addrlen, hbuf, sizeof(hbuf), NULL,
0, NI_NUMERICHOST) == 0)
fetch_info("connecting to %s:%d", hbuf,
htons(res->ai_family == AF_INET
? ((struct sockaddr_in *)(res->ai_addr))->sin_port
: ((struct sockaddr_in6 *)(res->ai_addr))->sin6_port));
fetch_info("connecting to %s", hbuf);
}
if (connect(sd, res->ai_addr, res->ai_addrlen) == -1) {