mirror of
https://github.com/curl/curl.git
synced 2026-08-25 22:13:33 +03:00
proxy: fix automatic tunnel mode with "connect to host"
Fix a regression in curl 8.21.0-rc3: Check whether the host and the "connect
to host" are equal before initializing the proxy. If they are equal, switching
to tunnel mode is not necessary.
Follow-up to 73daec6
Closes #22110
This commit is contained in:
parent
cb7efe1c35
commit
810d9535e1
3 changed files with 28 additions and 13 deletions
19
lib/url.c
19
lib/url.c
|
|
@ -2100,7 +2100,7 @@ static CURLcode url_create_needle(struct Curl_easy *data,
|
|||
Curl_hash_str, curlx_str_key_compare, conn_meta_freeentry);
|
||||
|
||||
/*************************************************************
|
||||
* Determine `conn->origin` and propulate `data->state.up` and
|
||||
* Determine `conn->origin` and populate `data->state.up` and
|
||||
* other URL related properties.
|
||||
*************************************************************/
|
||||
result = url_set_conn_origin_etc(data, needle);
|
||||
|
|
@ -2135,6 +2135,15 @@ static CURLcode url_create_needle(struct Curl_easy *data,
|
|||
goto out;
|
||||
}
|
||||
|
||||
/*************************************************************
|
||||
* Check whether the host and the "connect to host" are equal.
|
||||
* Do this after the hostnames have been IDN-converted and
|
||||
* before initializing the proxy.
|
||||
*************************************************************/
|
||||
if(Curl_peer_equal(needle->origin, needle->via_peer)) {
|
||||
Curl_peer_unlink(&needle->via_peer);
|
||||
}
|
||||
|
||||
#ifndef CURL_DISABLE_PROXY
|
||||
/* Going via a unix socket ignores any proxy settings */
|
||||
if(network_scheme &&
|
||||
|
|
@ -2149,14 +2158,6 @@ static CURLcode url_create_needle(struct Curl_easy *data,
|
|||
if(result)
|
||||
goto out;
|
||||
|
||||
/*************************************************************
|
||||
* Check whether the host and the "connect to host" are equal.
|
||||
* Do this after the hostnames have been IDN-converted.
|
||||
*************************************************************/
|
||||
if(Curl_peer_equal(needle->origin, needle->via_peer)) {
|
||||
Curl_peer_unlink(&needle->via_peer);
|
||||
}
|
||||
|
||||
/*************************************************************
|
||||
* Setup internals depending on protocol. Needs to be done after
|
||||
* we figured out what/if proxy to use.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue