diff options
author | Daniel Stenberg <daniel@haxx.se> | 2020-11-02 23:17:01 +0100 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2020-11-03 16:08:48 +0100 |
commit | 2cfc4ed98347047249b8f7f91ad513a4b0b84e45 (patch) | |
tree | 6e69f05aeeb76db0a7f15f9c8314f1e983ed42e8 /lib/setopt.c | |
parent | 7385610d0c74c6a254fea5e4cd6e1d559d848c8c (diff) | |
download | curl-2cfc4ed98347047249b8f7f91ad513a4b0b84e45.tar.gz |
hsts: add read/write callbacks
- read/write callback options
- man pages for the 4 new setopts
- test 1915 verifies the callbacks
Closes #5896
Diffstat (limited to 'lib/setopt.c')
-rw-r--r-- | lib/setopt.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/setopt.c b/lib/setopt.c index 4aa31bb39..7627557f5 100644 --- a/lib/setopt.c +++ b/lib/setopt.c @@ -2841,6 +2841,18 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option, va_list param) #endif break; #ifdef USE_HSTS + case CURLOPT_HSTSREADFUNCTION: + data->set.hsts_read = va_arg(param, curl_hstsread_callback); + break; + case CURLOPT_HSTSREADDATA: + data->set.hsts_read_userp = va_arg(param, void *); + break; + case CURLOPT_HSTSWRITEFUNCTION: + data->set.hsts_write = va_arg(param, curl_hstswrite_callback); + break; + case CURLOPT_HSTSWRITEDATA: + data->set.hsts_write_userp = va_arg(param, void *); + break; case CURLOPT_HSTS: if(!data->hsts) { data->hsts = Curl_hsts_init(); @@ -2852,7 +2864,7 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option, va_list param) if(result) return result; if(argptr) - (void)Curl_hsts_load(data->hsts, argptr); + (void)Curl_hsts_loadfile(data, data->hsts, argptr); break; case CURLOPT_HSTS_CTRL: arg = va_arg(param, long); |