lib: keep conn IP information together

new struct ip_quadruple for holding local/remote addr+port

- used in data->info and conn and cf-socket.c
- copy back and forth complete struct
- add 'secondary' to conn
- use secondary in reporting success for ftp 2nd connection

Reported-by: DasKutti on github
Fixes #13084
Closes #13090
This commit is contained in:
Stefan Eissing 2024-03-08 10:45:14 +01:00 committed by Daniel Stenberg
parent 1ccf1cd993
commit fcef00db1a
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
20 changed files with 148 additions and 200 deletions

View file

@ -341,7 +341,7 @@ static CURLproxycode do_SOCKS4(struct Curl_cfilter *cf,
case CONNECT_RESOLVING:
/* check if we have the name resolved by now */
dns = Curl_fetch_addr(data, sx->hostname, (int)conn->port);
dns = Curl_fetch_addr(data, sx->hostname, conn->primary.remote_port);
if(dns) {
#ifdef CURLRES_ASYNCH
@ -1175,7 +1175,7 @@ static CURLcode socks_proxy_cf_connect(struct Curl_cfilter *cf,
result = connect_SOCKS(cf, sx, data);
if(!result && sx->state == CONNECT_DONE) {
cf->connected = TRUE;
Curl_verboseconnect(data, conn);
Curl_verboseconnect(data, conn, cf->sockindex);
socks_proxy_cf_free(cf);
}