Skip to content

Commit

Permalink
connect: store "conn_remote_port" in the info struct
Browse files Browse the repository at this point in the history
To make it available after the connection ended.
  • Loading branch information
bagder committed Apr 25, 2022
1 parent c126299 commit 08b8ef4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/connect.c
Expand Up @@ -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;
}

Expand Down
6 changes: 5 additions & 1 deletion lib/urldata.h
Expand Up @@ -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;
Expand Down

0 comments on commit 08b8ef4

Please sign in to comment.