mirror of
https://github.com/curl/curl.git
synced 2026-08-24 10:33:31 +03:00
unix-sockets: ignore proxy settings
Fix a recent regression: when a unix-socket is configured, all proxy settings must be ignored. The `via_peer` had been checked correctly, but the connections proxy bits were not cleared. Add test_11_04 to verify. Reported-by: Fabian Keil (libcurl mailing list) Closes #21630
This commit is contained in:
parent
535c575e31
commit
ad549c4641
3 changed files with 22 additions and 6 deletions
11
lib/url.c
11
lib/url.c
|
|
@ -2627,10 +2627,13 @@ static CURLcode url_create_needle(struct Curl_easy *data,
|
|||
}
|
||||
|
||||
#ifndef CURL_DISABLE_PROXY
|
||||
/* After the Unix socket init but before the proxy vars are used, parse and
|
||||
* initialize the proxy settings.
|
||||
* Any UDS `via_peer` disables proxies. */
|
||||
if(network_scheme && !(needle->via_peer && needle->via_peer->unix_socket)) {
|
||||
/* Going via a unix socket ignores any proxy settings */
|
||||
if(needle->via_peer && needle->via_peer->unix_socket) {
|
||||
needle->bits.socksproxy = FALSE;
|
||||
needle->bits.httpproxy = FALSE;
|
||||
needle->bits.proxy = FALSE;
|
||||
}
|
||||
else if(network_scheme) {
|
||||
result = url_set_conn_proxies(data, needle);
|
||||
if(result)
|
||||
goto out;
|
||||
|
|
|
|||
|
|
@ -452,8 +452,8 @@ struct connectdata {
|
|||
|
||||
#ifndef CURL_DISABLE_PROXY
|
||||
#define CURL_CONN_HOST_DISPNAME(c) \
|
||||
((c)->bits.socksproxy ? (c)->socks_proxy.peer->user_hostname : \
|
||||
(c)->bits.httpproxy ? (c)->http_proxy.peer->user_hostname : \
|
||||
((c)->socks_proxy.peer ? (c)->socks_proxy.peer->user_hostname : \
|
||||
(c)->http_proxy.peer ? (c)->http_proxy.peer->user_hostname : \
|
||||
(c)->via_peer ? (c)->via_peer->user_hostname : \
|
||||
(c)->origin->user_hostname)
|
||||
#else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue