- 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
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, "
else {
CURL_TRC_SSLS(data, "no cached session for %s", ssl_peer_key);
}
+ Curl_ssl_scache_unlock(data);
return result;
}