GNURLOPT_ALTSVC(3)
π CURLOPT_ALTSVC: set alt-svc cache file name π
okay so bestie, welcome to the GNURLOPT_ALTSVC(3) page from the curl_easy_setopt options crew. We're talking alt-svc cache files, and yes, it's giving very specific libcurl behavior π
β¨ NAME β¨
CURLOPT_ALTSVC β set alt-svc cache file name
πΈ SYNOPSIS πΈ
#include <gnurl/curl.h>
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_ALTSVC, char *filename);
π§ͺ EXPERIMENTAL π§ͺ
Warning, bestie: this feature is early code and is marked as experimental. It can only be enabled by explicitly telling configure with --enable-alt-svc. You are advised to not ship this in production before the experimental label is removed. No cap, that's the actual warning π«Ά
π DESCRIPTION π
You pass in a pointer to a filename, and that tells libcurl to use that file as the Alt-Svc cache. It reads existing cache contents from it, and it may also write it back after a transfer β unless CURLALTSVC_READONLYFILE is set in CURLOPT_ALTSVC_CTRL(3).
Specify a blank file name ("") to make libcurl not load from a file at all. Literally blank, bestie π«§
π¦ DEFAULT π¦
NULL. The alt-svc cache is not read nor written to file.
π PROTOCOLS π
HTTPS
π EXAMPLE π
CURL *curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_ALTSVC_CTRL, CURLALTSVC_H1);
curl_easy_setopt(curl, CURLOPT_ALTSVC, "altsvc-cache.txt");
curl_easy_perform(curl);
}
β AVAILABILITY β
Added in 7.64.1
π RETURN VALUE π
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not. Simple as that β¨
π SEE ALSO π
k bye bestie β this page is from libcurl 7.64.1, dated 5 Feb 2019, and it's literally the GNURLOPT_ALTSVC(3) manual page π
β¨
π¦ where this page comes from
- nixos 26.05: libgnurl 7.72.0
- nixpkgs unstable: libgnurl 7.72.0
- Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms