From 076a2f629119222aeeb50f5a03bf9f9052fabb9a Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 27 Dec 2022 11:50:20 +0100 Subject: share: add sharing of HSTS cache among handles Closes #10138 --- lib/hsts.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'lib/hsts.c') 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 */ -- cgit v1.2.1