diff options
author | Daniel Stenberg <daniel@haxx.se> | 2022-12-27 11:50:20 +0100 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2022-12-27 15:22:01 +0100 |
commit | 076a2f629119222aeeb50f5a03bf9f9052fabb9a (patch) | |
tree | b5c95960e99f54fd32e6baa8c82a48ea21f2624e /lib/hsts.c | |
parent | 692c73707ab842f4282fdd6b52e83b0b7ca0d999 (diff) | |
download | curl-076a2f629119222aeeb50f5a03bf9f9052fabb9a.tar.gz |
share: add sharing of HSTS cache among handles
Closes #10138
Diffstat (limited to 'lib/hsts.c')
-rw-r--r-- | lib/hsts.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/hsts.c b/lib/hsts.c index c449120f3..339237be1 100644 --- a/lib/hsts.c +++ b/lib/hsts.c @@ -39,6 +39,7 @@ #include "parsedate.h" #include "fopen.h" #include "rename.h" +#include "share.h" /* The last 3 #include files should be in this order */ #include "curl_printf.h" @@ -551,4 +552,18 @@ CURLcode Curl_hsts_loadcb(struct Curl_easy *data, struct hsts *h) return CURLE_OK; } +void Curl_hsts_loadfiles(struct Curl_easy *data) +{ + struct curl_slist *l = data->set.hstslist; + if(l) { + Curl_share_lock(data, CURL_LOCK_DATA_HSTS, CURL_LOCK_ACCESS_SINGLE); + + while(l) { + (void)Curl_hsts_loadfile(data, data->hsts, l->data); + l = l->next; + } + Curl_share_unlock(data, CURL_LOCK_DATA_HSTS); + } +} + #endif /* CURL_DISABLE_HTTP || CURL_DISABLE_HSTS */ |