1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-24 00:58:48 -05:00

quiche: don't use primary_ip / primary_port

Closes #6555
This commit is contained in:
Alessandro Ghedini 2021-02-01 13:13:37 +00:00 committed by Daniel Stenberg
parent e58560bdaf
commit a0c5781cb6
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -179,6 +179,8 @@ CURLcode Curl_quic_connect(struct Curl_easy *data,
CURLcode result; CURLcode result;
struct quicsocket *qs = &conn->hequic[sockindex]; struct quicsocket *qs = &conn->hequic[sockindex];
char *keylog_file = NULL; char *keylog_file = NULL;
char ipbuf[40];
long port;
#ifdef DEBUG_QUICHE #ifdef DEBUG_QUICHE
/* initialize debug log callback only once */ /* initialize debug log callback only once */
@ -247,14 +249,17 @@ CURLcode Curl_quic_connect(struct Curl_easy *data,
if(result) if(result)
return result; return result;
/* store the used address as a string */ /* extract the used address as a string */
if(!Curl_addr2string((struct sockaddr*)addr, addrlen, if(!Curl_addr2string((struct sockaddr*)addr, addrlen, ipbuf, &port)) {
conn->primary_ip, &conn->primary_port)) {
char buffer[STRERROR_LEN]; char buffer[STRERROR_LEN];
failf(data, "ssrem inet_ntop() failed with errno %d: %s", failf(data, "ssrem inet_ntop() failed with errno %d: %s",
SOCKERRNO, Curl_strerror(SOCKERRNO, buffer, sizeof(buffer))); SOCKERRNO, Curl_strerror(SOCKERRNO, buffer, sizeof(buffer)));
return CURLE_BAD_FUNCTION_ARGUMENT; return CURLE_BAD_FUNCTION_ARGUMENT;
} }
infof(data, "Connect socket %d over QUIC to %s:%ld\n",
sockfd, ipbuf, port);
Curl_persistconninfo(data, conn, NULL, -1); Curl_persistconninfo(data, conn, NULL, -1);
/* for connection reuse purposes: */ /* for connection reuse purposes: */