]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
connect: store "conn_remote_port" in the info struct
authorDaniel Stenberg <daniel@haxx.se>
Mon, 25 Apr 2022 14:24:33 +0000 (16:24 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 25 Apr 2022 14:24:33 +0000 (16:24 +0200)
To make it available after the connection ended.

lib/connect.c
lib/urldata.h

index e0b740147157cd7a04758344da10ad7834f38f95..9bcf525ebb39f8b010d6491e0eb2b6a940be65c3 100644 (file)
@@ -623,6 +623,7 @@ void Curl_persistconninfo(struct Curl_easy *data, struct connectdata *conn,
   data->info.conn_scheme = conn->handler->scheme;
   data->info.conn_protocol = conn->handler->protocol;
   data->info.conn_primary_port = conn->port;
+  data->info.conn_remote_port = conn->remote_port;
   data->info.conn_local_port = local_port;
 }
 
index ef2174d9e727aa18186957118d69d2ee3c6a9619..9c34ec444c08fcdb93c88f3645b6ac2ac7376ea9 100644 (file)
@@ -1160,7 +1160,11 @@ struct PureInfo {
      reused, in the connection cache. */
 
   char conn_primary_ip[MAX_IPADR_LEN];
-  int conn_primary_port;
+  int conn_primary_port; /* this is the destination port to the connection,
+                            which might have been a proxy */
+  int conn_remote_port;  /* this is the "remote port", which is the port
+                            number of the used URL, independent of proxy or
+                            not */
   char conn_local_ip[MAX_IPADR_LEN];
   int conn_local_port;
   const char *conn_scheme;