mirror of
https://github.com/curl/curl.git
synced 2026-08-26 04:43:35 +03:00
altsvc: use Curl_peer in processing
Use `data->state.origin` when processing alt-avc information. Decomplexify parsing function. Closes #22184
This commit is contained in:
parent
2f1e94eaed
commit
cfc7922377
7 changed files with 247 additions and 198 deletions
11
lib/url.c
11
lib/url.c
|
|
@ -1901,7 +1901,7 @@ static CURLcode url_set_conn_peer(struct Curl_easy *data,
|
|||
struct connectdata *conn)
|
||||
{
|
||||
CURLcode result = CURLE_OK;
|
||||
const struct Curl_peer *origin = conn->origin;
|
||||
struct Curl_peer *origin = conn->origin;
|
||||
struct Curl_peer *via_peer = NULL;
|
||||
struct curl_slist *conn_to_entry = data->set.connect_to;
|
||||
|
||||
|
|
@ -1953,8 +1953,7 @@ static CURLcode url_set_conn_peer(struct Curl_easy *data,
|
|||
if(!hit && (neg->wanted & CURL_HTTP_V3x)) {
|
||||
srcalpnid = ALPN_h3;
|
||||
hit = Curl_altsvc_lookup(data->asi,
|
||||
ALPN_h3, origin->hostname,
|
||||
origin->port, /* from */
|
||||
origin, ALPN_h3, /* from */
|
||||
&as /* to */,
|
||||
allowed_alpns, &same_dest);
|
||||
}
|
||||
|
|
@ -1964,8 +1963,7 @@ static CURLcode url_set_conn_peer(struct Curl_easy *data,
|
|||
!neg->h2_prior_knowledge) {
|
||||
srcalpnid = ALPN_h2;
|
||||
hit = Curl_altsvc_lookup(data->asi,
|
||||
ALPN_h2, origin->hostname,
|
||||
origin->port, /* from */
|
||||
origin, ALPN_h2, /* from */
|
||||
&as /* to */,
|
||||
allowed_alpns, &same_dest);
|
||||
}
|
||||
|
|
@ -1974,8 +1972,7 @@ static CURLcode url_set_conn_peer(struct Curl_easy *data,
|
|||
!neg->only_10) {
|
||||
srcalpnid = ALPN_h1;
|
||||
hit = Curl_altsvc_lookup(data->asi,
|
||||
ALPN_h1, origin->hostname,
|
||||
origin->port, /* from */
|
||||
origin, ALPN_h1, /* from */
|
||||
&as /* to */,
|
||||
allowed_alpns, &same_dest);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue