Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Renamed AllowDraftHttp3 to AllowHttp3AndQuic app context switch
  • Loading branch information
ManickaP committed Jul 13, 2021
commit d5facbbc492c312200a5fe3ed6abf2e57c191150
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ internal static class SocketsHttpHandler
"DOTNET_SYSTEM_NET_HTTP_SOCKETSHTTPHANDLER_HTTP2SUPPORT",
true);

// Default to allowing draft HTTP/3, but enable that to be overridden
// by an AppContext switch, or by an environment variable being set to false/0.
public static bool AllowDraftHttp3 { get; } = RuntimeSettingParser.QueryRuntimeSettingSwitch(
"System.Net.SocketsHttpHandler.Http3DraftSupport",
"DOTNET_SYSTEM_NET_HTTP_SOCKETSHTTPHANDLER_HTTP3DRAFTSUPPORT",
true);
// Default to disable HTTP/3 and QUIC, but enable that to be overridden
// by an AppContext switch, or by an environment variable being set to true/1.
public static bool AllowHttp3AndQuic { get; } = RuntimeSettingParser.QueryRuntimeSettingSwitch(
"System.Net.SocketsHttpHandler.Http3AndQuicSupport",
"DOTNET_SYSTEM_NET_HTTP_SOCKETSHTTPHANDLER_HTTP3ANDQUICSUPPORT",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was the name of the switch discussed/approved somewhere? I just wonder why it was changed

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just wonder why it was changed

To express that it's used for S.N.Quic as well, which the original switch wasn't. Since S.N.Quic is "hidden" and shouldn't be used, it's not strictly needed. Not even I myself am 100% sure about the naming here 😄

About discussing it, it's happening here. AFAIK, switches are not strictly considered public API (e.g. #47583) so no need to go through API Review.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renamed as discussed offline.

false);

// Switch to disable the HTTP/2 dynamic window scaling algorithm. Enabled by default.
public static bool DisableDynamicHttp2WindowSizing { get; } = RuntimeSettingParser.QueryRuntimeSettingSwitch(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ internal sealed class HttpConnectionSettings
public HttpConnectionSettings()
{
bool allowHttp2 = GlobalHttpSettings.SocketsHttpHandler.AllowHttp2;
bool allowHttp3 = GlobalHttpSettings.SocketsHttpHandler.AllowDraftHttp3;
bool allowHttp3 = GlobalHttpSettings.SocketsHttpHandler.AllowHttp3AndQuic;
_maxHttpVersion =
allowHttp3 && allowHttp2 ? HttpVersion.Version30 :
allowHttp2 ? HttpVersion.Version20 :
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
<TargetFrameworks>$(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Linux;$(NetCoreAppCurrent)-Browser;$(NetCoreAppCurrent)-OSX</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
<RuntimeHostConfigurationOption Include="System.Net.SocketsHttpHandler.Http3AndQuicSupport" Value="true" />
</ItemGroup>

<PropertyGroup Condition="'$(TargetOS)' == 'Browser'">
<Scenario>WasmTestOnBrowser</Scenario>
<TestArchiveTestsRoot>$(TestArchiveRoot)browseronly/</TestArchiveTestsRoot>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<RuntimeHostConfigurationOption Include="System.Net.SocketsHttpHandler.Http3AndQuicSupport" Value="true" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Serilog.AspNetCore" Version="3.4.0" />
<PackageReference Include="Serilog.Extensions.Logging.File" Version="2.0.0" />
Expand Down