summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2021-11-02 09:10:12 +0100
committerDaniel Stenberg <daniel@haxx.se>2021-11-02 17:57:04 +0100
commitf5ee9cf5baaaeace5a05475553ea8142d9eca123 (patch)
treea9ed9a7ab7ac911f44dd4ce29bf5c7a5e332d710
parenta06ce29482e422e623acbc84d4e72b4f9ac99904 (diff)
downloadcurl-f5ee9cf5baaaeace5a05475553ea8142d9eca123.tar.gz
Curl_updateconninfo: store addresses for QUIC connections too
So that CURLINFO_PRIMARY_IP etc work for HTTP/3 like for other HTTP versions. Reported-by: Jerome Mao Fixes #7939 Closes #7944
-rw-r--r--lib/connect.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/lib/connect.c b/lib/connect.c
index 94490805a..af6094731 100644
--- a/lib/connect.c
+++ b/lib/connect.c
@@ -744,17 +744,15 @@ void Curl_conninfo_local(struct Curl_easy *data, curl_socket_t sockfd,
void Curl_updateconninfo(struct Curl_easy *data, struct connectdata *conn,
curl_socket_t sockfd)
{
- /* 'local_ip' and 'local_port' get filled with local's numerical
- ip address and port number whenever an outgoing connection is
- **established** from the primary socket to a remote address. */
+ /* 'local_ip' and 'local_port' get filled with local's numerical ip address
+ and port number whenever an outgoing connection is **established** from
+ the primary socket to a remote address. */
char local_ip[MAX_IPADR_LEN] = "";
int local_port = -1;
- if(conn->transport == TRNSPRT_TCP) {
- if(!conn->bits.reuse && !conn->bits.tcp_fastopen)
- Curl_conninfo_remote(data, conn, sockfd);
- Curl_conninfo_local(data, sockfd, local_ip, &local_port);
- } /* end of TCP-only section */
+ if(!conn->bits.reuse && !conn->bits.tcp_fastopen)
+ Curl_conninfo_remote(data, conn, sockfd);
+ Curl_conninfo_local(data, sockfd, local_ip, &local_port);
/* persist connection info in session handle */
Curl_persistconninfo(data, conn, local_ip, local_port);