Sortix main manual
This manual documents Sortix main. You can instead view this document in the latest official manual.
CURLOPT_HSTSWRITEFUNCTION(3) | curl_easy_setopt options | CURLOPT_HSTSWRITEFUNCTION(3) |
NAME
CURLOPT_HSTSWRITEFUNCTION - write 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] */
};
struct curl_index {
size_t index; /* the provided entry's "index" or count */
size_t total; /* total number of entries to save */
};
CURLSTScode hstswrite(CURL *easy, struct curl_hstsentry *sts,
struct curl_index *count, void *userp);
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_HSTSWRITEFUNCTION, hstswrite);
DESCRIPTION
Pass a pointer to your callback function, as the prototype shows above.DEFAULT
NULL - no callback.PROTOCOLS
This feature is only used for HTTP(S) transfer.EXAMPLE
{
/* set HSTS read callback */
curl_easy_setopt(curl, CURLOPT_HSTSWRITEFUNCTION, hstswrite);
/* pass in suitable argument to the callback */
curl_easy_setopt(curl, CURLOPT_HSTSWRITEDATA, &hstspreload[0]);
result = curl_easy_perform(curl);
}
AVAILABILITY
Added in 7.74.0RETURN VALUE
This will return CURLE_OK.SEE ALSO
CURLOPT_HSTSWRITEDATA(3), CURLOPT_HSTSWRITEFUNCTION(3), CURLOPT_HSTS(3), CURLOPT_HSTS_CTRL(3),May 17, 2022 | libcurl 7.84.0 |