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:
Stefan Eissing 2026-06-26 10:50:14 +02:00 committed by Daniel Stenberg
parent 2f1e94eaed
commit cfc7922377
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
7 changed files with 247 additions and 198 deletions

View file

@ -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);
}