altsvc: move logic from setopt into Curl_altsvc_ctrl()

To keep it all in one place.

Closes #20247
This commit is contained in:
Daniel Stenberg 2026-01-10 23:17:58 +01:00
parent 219245a616
commit 2725d3cb85
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
3 changed files with 13 additions and 14 deletions

View file

@ -310,10 +310,18 @@ CURLcode Curl_altsvc_load(struct altsvcinfo *asi, const char *file)
/*
* Curl_altsvc_ctrl() passes on the external bitmask.
*/
CURLcode Curl_altsvc_ctrl(struct altsvcinfo *asi, const long ctrl)
CURLcode Curl_altsvc_ctrl(struct Curl_easy *data, const long ctrl)
{
DEBUGASSERT(asi);
asi->flags = ctrl;
DEBUGASSERT(data);
if(!ctrl)
return CURLE_BAD_FUNCTION_ARGUMENT;
if(!data->asi) {
data->asi = Curl_altsvc_init();
if(!data->asi)
return CURLE_OUT_OF_MEMORY;
}
data->asi->flags = ctrl;
return CURLE_OK;
}