mirror of
https://github.com/curl/curl.git
synced 2026-06-07 18:44:19 +03:00
drop cast for CURLHSTS_ENABLE docs/examples, sync #define in docs
This commit is contained in:
parent
0867a9d9f7
commit
9e243ae651
2 changed files with 4 additions and 4 deletions
|
|
@ -87,7 +87,7 @@ int main(void)
|
|||
struct state st = {0};
|
||||
|
||||
/* enable HSTS for this handle */
|
||||
curl_easy_setopt(curl, CURLOPT_HSTS_CTRL, (long)CURLHSTS_ENABLE);
|
||||
curl_easy_setopt(curl, CURLOPT_HSTS_CTRL, CURLHSTS_ENABLE);
|
||||
|
||||
/* function to call at first to populate the cache before the transfer */
|
||||
curl_easy_setopt(curl, CURLOPT_HSTSREADFUNCTION, hstsread);
|
||||
|
|
|
|||
|
|
@ -23,8 +23,8 @@ CURLOPT_HSTS_CTRL - control HSTS behavior
|
|||
~~~c
|
||||
#include <curl/curl.h>
|
||||
|
||||
#define CURLHSTS_ENABLE (1<<0)
|
||||
#define CURLHSTS_READONLYFILE (1<<1)
|
||||
#define CURLHSTS_ENABLE (long)(1<<0)
|
||||
#define CURLHSTS_READONLYFILE (long)(1<<1)
|
||||
|
||||
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_HSTS_CTRL, long bitmask);
|
||||
~~~
|
||||
|
|
@ -64,7 +64,7 @@ int main(void)
|
|||
{
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
curl_easy_setopt(curl, CURLOPT_HSTS_CTRL, (long)CURLHSTS_ENABLE);
|
||||
curl_easy_setopt(curl, CURLOPT_HSTS_CTRL, CURLHSTS_ENABLE);
|
||||
curl_easy_perform(curl);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue