Skip to content

Commit 683c579

Browse files
ManickaPcarlossanlop
authored andcommitted
Merged PR 32906: [6.0] Disable QUIC entirely
Disabling QUIC and thus H/3 in .NET 6 entirely.
1 parent 0a9fee4 commit 683c579

File tree

1 file changed

+10
-1
lines changed
  • src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/MsQuic/Internal

1 file changed

+10
-1
lines changed

Diff for: src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/MsQuic/Internal/MsQuicApi.cs

+10-1
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,15 @@ private MsQuicApi(NativeApi* vtable)
131131
#pragma warning disable CA1810 // Initialize all static fields in 'MsQuicApi' when those fields are declared and remove the explicit static constructor
132132
static MsQuicApi()
133133
{
134+
// Completely disabled QUIC.
135+
IsQuicSupported = false;
136+
if (NetEventSource.Log.IsEnabled())
137+
{
138+
NetEventSource.Info(null, $"QUIC is completely disabled in .NET 6 due to critical defects fixed in later versions.");
139+
}
140+
return;
141+
142+
#pragma warning disable CS0162 // Unreachable code detected -- leaving the original code intact, instead of removing big chunks of code transitively
134143
if (OperatingSystem.IsWindows() && !IsWindowsVersionSupported())
135144
{
136145
if (NetEventSource.Log.IsEnabled())
@@ -163,7 +172,7 @@ static MsQuicApi()
163172
// Gracefully close the API table to free resources. The API table will be allocated lazily again if needed
164173
MsQuicClose(apiTable);
165174
}
166-
#pragma warning restore CA1810
175+
#pragma warning restore CA1810, CS0162
167176

168177
private static MsQuicApi AllocateMsQuicApi()
169178
{

0 commit comments

Comments
 (0)