mirror of
https://github.com/curl/curl.git
synced 2026-08-02 23:10:28 +03:00
altsvc: move logic from setopt into Curl_altsvc_ctrl()
To keep it all in one place. Closes #20247
This commit is contained in:
parent
219245a616
commit
2725d3cb85
3 changed files with 13 additions and 14 deletions
14
lib/altsvc.c
14
lib/altsvc.c
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue