File tree 1 file changed +7
-6
lines changed
src/libraries/System.Net.Quic/src/System/Net/Quic/Internal
1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -21,22 +21,23 @@ internal static partial class MsQuicConfiguration
21
21
private const string DisableCacheCtxSwitch = "System.Net.Quic.DisableConfigurationCache" ;
22
22
23
23
internal static bool ConfigurationCacheEnabled { get ; } = GetConfigurationCacheEnabled ( ) ;
24
+
24
25
private static bool GetConfigurationCacheEnabled ( )
25
26
{
26
27
// AppContext switch takes precedence
27
28
if ( AppContext . TryGetSwitch ( DisableCacheCtxSwitch , out bool value ) )
28
29
{
29
30
return ! value ;
30
31
}
31
- else
32
+ // check environment variable second
33
+ else if ( Environment . GetEnvironmentVariable ( DisableCacheEnvironmentVariable ) is string envVar )
32
34
{
33
- // check environment variable
34
- return
35
- Environment . GetEnvironmentVariable ( DisableCacheEnvironmentVariable ) is string envVar &&
36
- ! ( envVar == "1" || envVar . Equals ( "true" , StringComparison . OrdinalIgnoreCase ) ) ;
35
+ return ! ( envVar == "1" || envVar . Equals ( "true" , StringComparison . OrdinalIgnoreCase ) ) ;
37
36
}
38
- }
39
37
38
+ // enabled by default
39
+ return true ;
40
+ }
40
41
private static readonly ConcurrentDictionary < CacheKey , MsQuicConfigurationSafeHandle > s_configurationCache = new ( ) ;
41
42
42
43
private readonly struct CacheKey : IEquatable < CacheKey >
You can’t perform that action at this time.
0 commit comments