Sortix nightly manual
This manual documents Sortix nightly, a development build that has not been officially released. You can instead view this document in the latest official manual.
CURLOPT_HSTSREADFUNCTION(3) | Library Functions Manual | CURLOPT_HSTSREADFUNCTION(3) |
NAME
CURLOPT_HSTSREADFUNCTION - read callback for HSTS hostsSYNOPSIS
#include <curl/curl.h>
struct curl_hstsentry {
char *name;
size_t namelen;
unsigned int includeSubDomains:1;
char expire[18]; /* YYYYMMDD HH:MM:SS [null-terminated] */
};
CURLSTScode hstsread(CURL *easy, struct curl_hstsentry *sts, void *clientp);
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_HSTSREADFUNCTION, hstsread);
DESCRIPTION
Pass a pointer to your callback function, as the prototype shows above.DEFAULT
NULL - no callback.PROTOCOLS
This functionality affects http onlyEXAMPLE
struct priv {
void *custom;
};
static CURLSTScode hsts_cb(CURL *easy, struct curl_hstsentry *sts,
void *clientp)
{
/* populate the struct as documented */
return CURLSTS_OK;
}
int main(void)
{
CURL *curl = curl_easy_init();
if(curl) {
struct priv my_stuff;
CURLcode res;
/* set HSTS read callback */
curl_easy_setopt(curl, CURLOPT_HSTSREADFUNCTION, hsts_cb);
/* pass in suitable argument to the callback */
curl_easy_setopt(curl, CURLOPT_HSTSREADDATA, &my_stuff);
res = curl_easy_perform(curl);
}
}
AVAILABILITY
Added in curl 7.74.0RETURN VALUE
This returns CURLE_OK.SEE ALSO
CURLOPT_HSTS(3), CURLOPT_HSTSREADDATA(3), CURLOPT_HSTSWRITEFUNCTION(3), CURLOPT_HSTS_CTRL(3)2024-12-21 | libcurl |