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}");
128if (NetEventSource.Log.IsEnabled()) NetEventSource.Info(null, $"Not found or invalid, Current Cache Count = {s_cachedCreds.Count}");
139return s_cachedCreds.TryGetValue(key, out SafeCredentialReference? cached) ? cached.Target : null;
163if (NetEventSource.Log.IsEnabled()) NetEventSource.Info(null, $"Refused to cache an Invalid Handle {creds}, Current Cache Count = {s_cachedCreds.Count}");
174lock (s_cachedCreds)
187s_cachedCreds[key] = cached;
188if (NetEventSource.Log.IsEnabled()) NetEventSource.Info(null, $"Caching New Handle = {creds}, Current Cache Count = {s_cachedCreds.Count}");
217if ((s_cachedCreds.Count % CheckExpiredModulo) == 0)
219KeyValuePair<SslCredKey, SafeCredentialReference>[] toRemoveAttempt = s_cachedCreds.ToArray();
228s_cachedCreds.TryRemove(toRemoveAttempt[i].Key, out _);
236s_cachedCreds[toRemoveAttempt[i].Key] = cached;
240s_cachedCreds.TryRemove(toRemoveAttempt[i].Key, out _);
244if (NetEventSource.Log.IsEnabled()) NetEventSource.Info(null, $"Scavenged cache, New Cache Count = {s_cachedCreds.Count}");