From: Daniel Stenberg Date: Mon, 25 Apr 2022 14:24:33 +0000 (+0200) Subject: connect: store "conn_remote_port" in the info struct X-Git-Tag: curl-7_83_0~10 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=08b8ef4e726ba10f45081ecda5b3cea788d3c839;p=thirdparty%2Fcurl.git connect: store "conn_remote_port" in the info struct To make it available after the connection ended. --- diff --git a/lib/connect.c b/lib/connect.c index e0b7401471..9bcf525ebb 100644 --- a/lib/connect.c +++ b/lib/connect.c @@ -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; } diff --git a/lib/urldata.h b/lib/urldata.h index ef2174d9e7..9c34ec444c 100644 --- a/lib/urldata.h +++ b/lib/urldata.h @@ -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;