diff options
author | Patrick Monnerat <patrick@monnerat.net> | 2018-05-28 20:29:15 +0200 |
---|---|---|
committer | Patrick Monnerat <patrick@monnerat.net> | 2018-05-28 20:37:14 +0200 |
commit | 8541d02c967c993f6e36fd78c59c50b70315ac91 (patch) | |
tree | d3084a668426bd32295cd7acf517e934670317c1 /lib/setopt.c | |
parent | 536e9f828997c39d67fcf09cb3b2c19d4cf216cc (diff) | |
download | curl-8541d02c967c993f6e36fd78c59c50b70315ac91.tar.gz |
psl: use latest psl and refresh it periodically
The latest psl is cached in the multi or share handle. It is refreshed
before use after 72 hours.
New share lock CURL_LOCK_DATA_PSL controls the psl cache sharing.
If the latest psl is not available, the builtin psl is used.
Reported-by: Yaakov Selkowitz
Fixes #2553
Closes #2601
Diffstat (limited to 'lib/setopt.c')
-rw-r--r-- | lib/setopt.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/setopt.c b/lib/setopt.c index af53ee3ef..c1f6bd97e 100644 --- a/lib/setopt.c +++ b/lib/setopt.c @@ -1942,6 +1942,11 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option, if(data->share->sslsession == data->state.session) data->state.session = NULL; +#ifdef USE_LIBPSL + if(data->psl == &data->share->psl) + data->psl = data->multi? &data->multi->psl: NULL; +#endif + data->share->dirty--; Curl_share_unlock(data, CURL_LOCK_DATA_SHARE); @@ -1973,8 +1978,12 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option, data->set.general_ssl.max_ssl_sessions = data->share->max_ssl_sessions; data->state.session = data->share->sslsession; } - Curl_share_unlock(data, CURL_LOCK_DATA_SHARE); +#ifdef USE_LIBPSL + if(data->share->specifier & (1 << CURL_LOCK_DATA_PSL)) + data->psl = &data->share->psl; +#endif + Curl_share_unlock(data, CURL_LOCK_DATA_SHARE); } /* check for host cache not needed, * it will be done by curl_easy_perform */ |