summaryrefslogtreecommitdiff
path: root/lib/hsts.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2022-12-27 11:50:20 +0100
committerDaniel Stenberg <daniel@haxx.se>2022-12-27 15:22:01 +0100
commit076a2f629119222aeeb50f5a03bf9f9052fabb9a (patch)
treeb5c95960e99f54fd32e6baa8c82a48ea21f2624e /lib/hsts.c
parent692c73707ab842f4282fdd6b52e83b0b7ca0d999 (diff)
downloadcurl-076a2f629119222aeeb50f5a03bf9f9052fabb9a.tar.gz
share: add sharing of HSTS cache among handles
Closes #10138
Diffstat (limited to 'lib/hsts.c')
-rw-r--r--lib/hsts.c15
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 */