socks filter: pass operation parameters

Pass all operations parameters to a SOCKS filter at creation
time, not relying on "global" connectdata values.

Eliminate modifications to `conn->ip_version` when local resolving
for SOCKS4.

Do not retrieve the socket for GSSAPI blocking calls from connectdata,
but from the filters "below" the SOCKS one.

Closes #21436
This commit is contained in:
Stefan Eissing 2026-04-24 10:38:22 +02:00 committed by Daniel Stenberg
parent 7d295145eb
commit 4840fe3f8a
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
3 changed files with 143 additions and 104 deletions

View file

@ -46,8 +46,19 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf,
struct Curl_easy *data);
#endif
/* Insert a SOCKS filter after `cf_at` for connecting to `hostname`
* and `port` with optional credentials.
* Credentials are NOT duplicated and are
* expected to exist during connect phase.
*/
CURLcode Curl_cf_socks_proxy_insert_after(struct Curl_cfilter *cf_at,
struct Curl_easy *data);
struct Curl_easy *data,
const char *hostname,
uint16_t port,
uint8_t ip_version,
uint8_t proxy_type,
const char *user,
const char *passwd);
extern struct Curl_cftype Curl_cft_socks_proxy;