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

@ -1261,16 +1261,7 @@ static CURLcode setopt_long(struct Curl_easy *data, CURLoption option,
#endif /* !CURL_DISABLE_HSTS */
#ifndef CURL_DISABLE_ALTSVC
case CURLOPT_ALTSVC_CTRL:
if(!arg) {
DEBUGF(infof(data, "bad CURLOPT_ALTSVC_CTRL input"));
return CURLE_BAD_FUNCTION_ARGUMENT;
}
if(!data->asi) {
data->asi = Curl_altsvc_init();
if(!data->asi)
return CURLE_OUT_OF_MEMORY;
}
return Curl_altsvc_ctrl(data->asi, arg);
return Curl_altsvc_ctrl(data, arg);
#endif /* !CURL_DISABLE_ALTSVC */
#ifndef CURL_DISABLE_WEBSOCKETS
case CURLOPT_WS_OPTIONS: