System\Net\Security\SslSessionsCache.cs (14)
117if (s_cachedCreds.IsEmpty)
119if (NetEventSource.Log.IsEnabled()) NetEventSource.Info(null, $"Not found, Current Cache Count = {s_cachedCreds.Count}");
129if (NetEventSource.Log.IsEnabled()) NetEventSource.Info(null, $"Not found or invalid, Current Cache Count = {s_cachedCreds.Count}");
140return s_cachedCreds.TryGetValue(key, out SafeCredentialReference? cached) ? cached.Target : null;
164if (NetEventSource.Log.IsEnabled()) NetEventSource.Info(null, $"Refused to cache an Invalid Handle {creds}, Current Cache Count = {s_cachedCreds.Count}");
175lock (s_cachedCreds)
188s_cachedCreds[key] = cached;
189if (NetEventSource.Log.IsEnabled()) NetEventSource.Info(null, $"Caching New Handle = {creds}, Current Cache Count = {s_cachedCreds.Count}");
218if ((s_cachedCreds.Count % CheckExpiredModulo) == 0)
220KeyValuePair<SslCredKey, SafeCredentialReference>[] toRemoveAttempt = s_cachedCreds.ToArray();
229s_cachedCreds.TryRemove(toRemoveAttempt[i].Key, out _);
237s_cachedCreds[toRemoveAttempt[i].Key] = cached;
241s_cachedCreds.TryRemove(toRemoveAttempt[i].Key, out _);
245if (NetEventSource.Log.IsEnabled()) NetEventSource.Info(null, $"Scavenged cache, New Cache Count = {s_cachedCreds.Count}");