File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
src/libraries/System.Net.Quic/src/System/Net/Quic/Internal Expand file tree Collapse file tree 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
2121 private const string DisableCacheCtxSwitch = "System.Net.Quic.DisableConfigurationCache" ;
2222
2323 internal static bool ConfigurationCacheEnabled { get ; } = GetConfigurationCacheEnabled ( ) ;
24+
2425 private static bool GetConfigurationCacheEnabled ( )
2526 {
2627 // AppContext switch takes precedence
2728 if ( AppContext . TryGetSwitch ( DisableCacheCtxSwitch , out bool value ) )
2829 {
2930 return ! value ;
3031 }
31- else
32+ // check environment variable second
33+ else if ( Environment . GetEnvironmentVariable ( DisableCacheEnvironmentVariable ) is string envVar )
3234 {
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 ) ) ;
3736 }
38- }
3937
38+ // enabled by default
39+ return true ;
40+ }
4041 private static readonly ConcurrentDictionary < CacheKey , MsQuicConfigurationSafeHandle > s_configurationCache = new ( ) ;
4142
4243 private readonly struct CacheKey : IEquatable < CacheKey >
You can’t perform that action at this time.
0 commit comments