diff options
Diffstat (limited to 'lib/connect.c')
-rw-r--r-- | lib/connect.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/connect.c b/lib/connect.c index af6094731..94490805a 100644 --- a/lib/connect.c +++ b/lib/connect.c @@ -744,15 +744,17 @@ 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->bits.reuse && !conn->bits.tcp_fastopen) - Curl_conninfo_remote(data, conn, sockfd); - Curl_conninfo_local(data, sockfd, local_ip, &local_port); + 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 */ /* persist connection info in session handle */ Curl_persistconninfo(data, conn, local_ip, local_port); |