mirror of
https://github.com/curl/curl.git
synced 2026-04-15 00:21:42 +03:00
vtls_scache: fix race condition
- Lock before counting the cache sessions. Prior to this change when taking a session a trace command counted the sessions but not under lock, which caused a race condition. Reported by: Viktor Szakats Fixes https://github.com/curl/curl/issues/18806 Closes https://github.com/curl/curl/pull/18813
This commit is contained in:
parent
03fe446789
commit
2a25ebe958
1 changed files with 1 additions and 1 deletions
|
|
@ -902,7 +902,6 @@ CURLcode Curl_ssl_scache_take(struct Curl_cfilter *cf,
|
|||
peer->age = scache->age; /* set this as used in this age */
|
||||
}
|
||||
}
|
||||
Curl_ssl_scache_unlock(data);
|
||||
if(s) {
|
||||
*ps = s;
|
||||
CURL_TRC_SSLS(data, "took session for %s [proto=0x%x, "
|
||||
|
|
@ -914,6 +913,7 @@ CURLcode Curl_ssl_scache_take(struct Curl_cfilter *cf,
|
|||
else {
|
||||
CURL_TRC_SSLS(data, "no cached session for %s", ssl_peer_key);
|
||||
}
|
||||
Curl_ssl_scache_unlock(data);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue