static void RunTest(string defaultValueStr) { bool expected = bool.Parse(defaultValueStr); bool actual = RuntimeSettingParser.QueryRuntimeSettingSwitch("Foo.Bar", "FOO_BAR", expected); Assert.Equal(expected, actual); }
private static double GetHttp2StreamWindowScaleThresholdMultiplier() { double value = RuntimeSettingParser.ParseDoubleEnvironmentVariableValue( "DOTNET_SYSTEM_NET_HTTP_SOCKETSHTTPHANDLER_FLOWCONTROL_STREAMWINDOWSCALETHRESHOLDMULTIPLIER", DefaultHttp2StreamWindowScaleThresholdMultiplier); // Disallow negative values: if (value < 0) { value = DefaultHttp2StreamWindowScaleThresholdMultiplier; } return(value); }
private static int GetMaxHttp2StreamWindowSize() { int value = RuntimeSettingParser.ParseInt32EnvironmentVariableValue( "DOTNET_SYSTEM_NET_HTTP_SOCKETSHTTPHANDLER_FLOWCONTROL_MAXSTREAMWINDOWSIZE", DefaultHttp2MaxStreamWindowSize); // Disallow small values: if (value < HttpHandlerDefaults.DefaultInitialHttp2StreamWindowSize) { value = HttpHandlerDefaults.DefaultInitialHttp2StreamWindowSize; } return(value); }
private static int GetMaxConnectionsPerServer() { int value = RuntimeSettingParser.QueryRuntimeSettingInt32( "System.Net.SocketsHttpHandler.MaxConnectionsPerServer", "DOTNET_SYSTEM_NET_HTTP_SOCKETSHTTPHANDLER_MAXCONNECTIONSPERSERVER", int.MaxValue); // Disallow invalid values if (value < 1) { value = int.MaxValue; } return(value); }