Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/dotnet/runtime.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Ross <Tratcher@Outlook.com>2020-02-20 21:21:24 +0300
committerGitHub <noreply@github.com>2020-02-20 21:21:24 +0300
commit3c523a6a7a3ebc25fe524359127b1d8846e23ea3 (patch)
tree2e88d2da73284ebd3d289f5ca14346cef79a23a2
parentaac8f91cc5510b3d271d86eef616b6007b6e6631 (diff)
Move System.Net.Quic to internal shared source (#32549)v5.0.0-preview.1.20120.5
-rw-r--r--src/libraries/Common/src/System/Net/Http/aspnetcore/NetEventSource.Common.cs738
-rw-r--r--src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Implementations/Mock/MockConnection.cs (renamed from src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/Mock/MockConnection.cs)0
-rw-r--r--src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Implementations/Mock/MockImplementationProvider.cs (renamed from src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/Mock/MockImplementationProvider.cs)0
-rw-r--r--src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Implementations/Mock/MockListener.cs (renamed from src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/Mock/MockListener.cs)0
-rw-r--r--src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Implementations/Mock/MockStream.cs (renamed from src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/Mock/MockStream.cs)0
-rw-r--r--src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Implementations/MsQuic/Internal/MsQuicAddressHelpers.cs (renamed from src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/MsQuic/Internal/MsQuicAddressHelpers.cs)0
-rw-r--r--src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Implementations/MsQuic/Internal/MsQuicApi.cs (renamed from src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/MsQuic/Internal/MsQuicApi.cs)0
-rw-r--r--src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Implementations/MsQuic/Internal/MsQuicParameterHelpers.cs (renamed from src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/MsQuic/Internal/MsQuicParameterHelpers.cs)0
-rw-r--r--src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Implementations/MsQuic/Internal/MsQuicSecurityConfig.cs (renamed from src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/MsQuic/Internal/MsQuicSecurityConfig.cs)0
-rw-r--r--src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Implementations/MsQuic/Internal/MsQuicSession.cs (renamed from src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/MsQuic/Internal/MsQuicSession.cs)0
-rw-r--r--src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Implementations/MsQuic/Internal/QuicExceptionHelpers.cs (renamed from src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/MsQuic/Internal/QuicExceptionHelpers.cs)0
-rw-r--r--src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Implementations/MsQuic/Internal/ResettableCompletionSource.cs (renamed from src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/MsQuic/Internal/ResettableCompletionSource.cs)0
-rw-r--r--src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Implementations/MsQuic/MsQuicConnection.cs (renamed from src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/MsQuic/MsQuicConnection.cs)0
-rw-r--r--src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Implementations/MsQuic/MsQuicImplementationProvider.cs (renamed from src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/MsQuic/MsQuicImplementationProvider.cs)0
-rw-r--r--src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Implementations/MsQuic/MsQuicListener.cs (renamed from src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/MsQuic/MsQuicListener.cs)3
-rw-r--r--src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Implementations/MsQuic/MsQuicStream.cs (renamed from src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/MsQuic/MsQuicStream.cs)0
-rw-r--r--src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Implementations/QuicConnectionProvider.cs (renamed from src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/QuicConnectionProvider.cs)0
-rw-r--r--src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Implementations/QuicImplementationProvider.cs (renamed from src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/QuicImplementationProvider.cs)2
-rw-r--r--src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Implementations/QuicListenerProvider.cs (renamed from src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/QuicListenerProvider.cs)0
-rw-r--r--src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Implementations/QuicStreamProvider.cs (renamed from src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/QuicStreamProvider.cs)0
-rw-r--r--src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Interop/Interop.MsQuic.cs (renamed from src/libraries/System.Net.Quic/src/Interop/Interop.MsQuic.cs)0
-rw-r--r--src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Interop/MsQuicEnums.cs (renamed from src/libraries/System.Net.Quic/src/Interop/MsQuicEnums.cs)0
-rw-r--r--src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Interop/MsQuicNativeMethods.cs (renamed from src/libraries/System.Net.Quic/src/Interop/MsQuicNativeMethods.cs)0
-rw-r--r--src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Interop/MsQuicStatusCodes.cs121
-rw-r--r--src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Interop/MsQuicStatusHelper.cs (renamed from src/libraries/System.Net.Quic/src/Interop/Linux/MsQuicStatusHelper.cs)14
-rw-r--r--src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/NetEventSource.Quic.cs (renamed from src/libraries/System.Net.Quic/src/System/Net/Quic/NetEventSource.Quic.cs)0
-rw-r--r--src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/QuicClientConnectionOptions.cs (renamed from src/libraries/System.Net.Quic/src/System/Net/Quic/QuicClientConnectionOptions.cs)2
-rw-r--r--src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/QuicConnection.cs (renamed from src/libraries/System.Net.Quic/src/System/Net/Quic/QuicConnection.cs)2
-rw-r--r--src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/QuicConnectionAbortedException.cs (renamed from src/libraries/System.Net.Quic/src/System/Net/Quic/QuicConnectionAbortedException.cs)2
-rw-r--r--src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/QuicException.cs (renamed from src/libraries/System.Net.Quic/src/System/Net/Quic/QuicException.cs)2
-rw-r--r--src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/QuicImplementationProviders.cs (renamed from src/libraries/System.Net.Quic/src/System/Net/Quic/QuicImplementationProviders.cs)2
-rw-r--r--src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/QuicListener.cs (renamed from src/libraries/System.Net.Quic/src/System/Net/Quic/QuicListener.cs)2
-rw-r--r--src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/QuicListenerOptions.cs (renamed from src/libraries/System.Net.Quic/src/System/Net/Quic/QuicListenerOptions.cs)2
-rw-r--r--src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/QuicOperationAbortedException.cs (renamed from src/libraries/System.Net.Quic/src/System/Net/Quic/QuicOperationAbortedException.cs)2
-rw-r--r--src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/QuicStream.cs (renamed from src/libraries/System.Net.Quic/src/System/Net/Quic/QuicStream.cs)2
-rw-r--r--src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/QuicStreamAbortedException.cs (renamed from src/libraries/System.Net.Quic/src/System/Net/Quic/QuicStreamAbortedException.cs)2
-rw-r--r--src/libraries/Common/src/System/Net/Http/aspnetcore/SR.Quic.cs20
-rw-r--r--src/libraries/Common/src/System/Net/Http/aspnetcore/SR.resx12
-rw-r--r--src/libraries/Common/tests/Common.Tests.csproj124
-rw-r--r--src/libraries/Common/tests/Resources/Strings.resx12
-rw-r--r--src/libraries/Common/tests/System/Net/Http/Http3LoopbackConnection.cs2
-rw-r--r--src/libraries/Common/tests/System/Net/Http/Http3LoopbackStream.cs2
-rw-r--r--src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTestBase.cs2
-rw-r--r--src/libraries/System.Net.Http.WinHttpHandler/tests/FunctionalTests/System.Net.Http.WinHttpHandler.Functional.Tests.csproj9
-rw-r--r--src/libraries/System.Net.Http/src/PInvokeAnalyzerExceptionList.analyzerdata (renamed from src/libraries/System.Net.Quic/src/PInvokeAnalyzerExceptionList.analyzerdata)0
-rw-r--r--src/libraries/System.Net.Http/src/Resources/SR.resx (renamed from src/libraries/System.Net.Quic/src/Resources/Strings.resx)45
-rw-r--r--src/libraries/System.Net.Http/src/Resources/Strings.resx12
-rw-r--r--src/libraries/System.Net.Http/src/System.Net.Http.csproj132
-rw-r--r--src/libraries/System.Net.Http/tests/FunctionalTests/MsQuicTestBase.cs (renamed from src/libraries/System.Net.Quic/tests/FunctionalTests/MsQuicTestBase.cs)8
-rw-r--r--src/libraries/System.Net.Http/tests/FunctionalTests/MsQuicTests.cs (renamed from src/libraries/System.Net.Quic/tests/FunctionalTests/MsQuicTests.cs)0
-rw-r--r--src/libraries/System.Net.Http/tests/FunctionalTests/QuicConnectionTests.cs (renamed from src/libraries/System.Net.Quic/tests/FunctionalTests/QuicConnectionTests.cs)0
-rw-r--r--src/libraries/System.Net.Http/tests/FunctionalTests/QuicListenerTests.cs (renamed from src/libraries/System.Net.Quic/tests/FunctionalTests/QuicListenerTests.cs)0
-rw-r--r--src/libraries/System.Net.Http/tests/FunctionalTests/QuicStreamTests.cs (renamed from src/libraries/System.Net.Quic/tests/FunctionalTests/QuicStreamTests.cs)0
-rw-r--r--src/libraries/System.Net.Http/tests/FunctionalTests/System.Net.Http.Functional.Tests.csproj141
-rw-r--r--src/libraries/System.Net.Quic/Directory.Build.props11
-rw-r--r--src/libraries/System.Net.Quic/System.Net.Quic.sln53
-rw-r--r--src/libraries/System.Net.Quic/ref/System.Net.Quic.Temporary.cs35
-rw-r--r--src/libraries/System.Net.Quic/ref/System.Net.Quic.cs104
-rw-r--r--src/libraries/System.Net.Quic/ref/System.Net.Quic.csproj16
-rw-r--r--src/libraries/System.Net.Quic/src/Interop/Linux/MsQuicStatusCodes.cs56
-rw-r--r--src/libraries/System.Net.Quic/src/Interop/OSX/MsQuicStatusCodes.cs35
-rw-r--r--src/libraries/System.Net.Quic/src/Interop/OSX/MsQuicStatusHelper.cs16
-rw-r--r--src/libraries/System.Net.Quic/src/Interop/Windows/MsQuicStatusCodes.cs56
-rw-r--r--src/libraries/System.Net.Quic/src/Interop/Windows/MsQuicStatusHelper.cs16
-rw-r--r--src/libraries/System.Net.Quic/src/System.Net.Quic.csproj107
-rw-r--r--src/libraries/System.Net.Quic/tests/FunctionalTests/System.Net.Quic.Tests.csproj19
66 files changed, 1372 insertions, 571 deletions
diff --git a/src/libraries/Common/src/System/Net/Http/aspnetcore/NetEventSource.Common.cs b/src/libraries/Common/src/System/Net/Http/aspnetcore/NetEventSource.Common.cs
new file mode 100644
index 00000000000..46cd2ee685c
--- /dev/null
+++ b/src/libraries/Common/src/System/Net/Http/aspnetcore/NetEventSource.Common.cs
@@ -0,0 +1,738 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+#if DEBUG
+// Uncomment to enable runtime checks to help validate that NetEventSource isn't being misused
+// in a way that will cause performance problems, e.g. unexpected boxing of value types.
+//#define DEBUG_NETEVENTSOURCE_MISUSE
+#endif
+
+#nullable enable
+using System.Collections;
+using System.Diagnostics;
+using System.Diagnostics.Tracing;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+#if NET46
+using System.Security;
+#endif
+
+#pragma warning disable CA1823 // not all IDs are used by all partial providers
+
+namespace System.Net
+{
+ // Implementation:
+ // This partial file is meant to be consumed into each System.Net.* assembly that needs to log. Each such assembly also provides
+ // its own NetEventSource partial class that adds an appropriate [EventSource] attribute, giving it a unique name for that assembly.
+ // Those partials can then also add additional events if needed, starting numbering from the NextAvailableEventId defined by this partial.
+
+ // Usage:
+ // - Operations that may allocate (e.g. boxing a value type, using string interpolation, etc.) or that may have computations
+ // at call sites should guard access like:
+ // if (NetEventSource.IsEnabled) NetEventSource.Enter(this, refArg1, valueTypeArg2); // entering an instance method with a value type arg
+ // if (NetEventSource.IsEnabled) NetEventSource.Info(null, $"Found certificate: {cert}"); // info logging with a formattable string
+ // - Operations that have zero allocations / measurable computations at call sites can use a simpler pattern, calling methods like:
+ // NetEventSource.Enter(this); // entering an instance method
+ // NetEventSource.Info(this, "literal string"); // arbitrary message with a literal string
+ // NetEventSource.Enter(this, refArg1, regArg2); // entering an instance method with two reference type arguments
+ // NetEventSource.Enter(null); // entering a static method
+ // NetEventSource.Enter(null, refArg1); // entering a static method with one reference type argument
+ // Debug.Asserts inside the logging methods will help to flag some misuse if the DEBUG_NETEVENTSOURCE_MISUSE compilation constant is defined.
+ // However, because it can be difficult by observation to understand all of the costs involved, guarding can be done everywhere.
+ // - NetEventSource.Fail calls typically do not need to be prefixed with an IsEnabled check, even if they allocate, as FailMessage
+ // should only be used in cases similar to Debug.Fail, where they are not expected to happen in retail builds, and thus extra costs
+ // don't matter.
+ // - Messages can be strings, formattable strings, or any other object. Objects (including those used in formattable strings) have special
+ // formatting applied, controlled by the Format method. Partial specializations can also override this formatting by implementing a partial
+ // method that takes an object and optionally provides a string representation of it, in case a particular library wants to customize further.
+
+ /// <summary>Provides logging facilities for System.Net libraries.</summary>
+#if NET46
+ [SecuritySafeCritical]
+#endif
+ internal sealed partial class NetEventSource : EventSource
+ {
+ /// <summary>The single event source instance to use for all logging.</summary>
+ public static readonly NetEventSource Log = new NetEventSource();
+
+ #region Metadata
+ public class Keywords
+ {
+ public const EventKeywords Default = (EventKeywords)0x0001;
+ public const EventKeywords Debug = (EventKeywords)0x0002;
+ public const EventKeywords EnterExit = (EventKeywords)0x0004;
+ }
+
+ private const string MissingMember = "(?)";
+ private const string NullInstance = "(null)";
+ private const string StaticMethodObject = "(static)";
+ private const string NoParameters = "";
+ private const int MaxDumpSize = 1024;
+
+ private const int EnterEventId = 1;
+ private const int ExitEventId = 2;
+ private const int AssociateEventId = 3;
+ private const int InfoEventId = 4;
+ private const int ErrorEventId = 5;
+ private const int CriticalFailureEventId = 6;
+ private const int DumpArrayEventId = 7;
+
+ // These events are implemented in NetEventSource.Security.cs.
+ // Define the ids here so that projects that include NetEventSource.Security.cs will not have conflicts.
+ private const int EnumerateSecurityPackagesId = 8;
+ private const int SspiPackageNotFoundId = 9;
+ private const int AcquireDefaultCredentialId = 10;
+ private const int AcquireCredentialsHandleId = 11;
+ private const int InitializeSecurityContextId = 12;
+ private const int SecurityContextInputBufferId = 13;
+ private const int SecurityContextInputBuffersId = 14;
+ private const int AcceptSecuritContextId = 15;
+ private const int OperationReturnedSomethingId = 16;
+
+ private const int NextAvailableEventId = 17; // Update this value whenever new events are added. Derived types should base all events off of this to avoid conflicts.
+ #endregion
+
+ #region Events
+ #region Enter
+ /// <summary>Logs entrance to a method.</summary>
+ /// <param name="thisOrContextObject">`this`, or another object that serves to provide context for the operation.</param>
+ /// <param name="formattableString">A description of the entrance, including any arguments to the call.</param>
+ /// <param name="memberName">The calling member.</param>
+ [NonEvent]
+ public static void Enter(object? thisOrContextObject, FormattableString? formattableString = null, [CallerMemberName] string? memberName = null)
+ {
+ DebugValidateArg(thisOrContextObject);
+ DebugValidateArg(formattableString);
+ if (IsEnabled) Log.Enter(IdOf(thisOrContextObject), memberName, formattableString != null ? Format(formattableString) : NoParameters);
+ }
+
+ /// <summary>Logs entrance to a method.</summary>
+ /// <param name="thisOrContextObject">`this`, or another object that serves to provide context for the operation.</param>
+ /// <param name="arg0">The object to log.</param>
+ /// <param name="memberName">The calling member.</param>
+ [NonEvent]
+ public static void Enter(object? thisOrContextObject, object arg0, [CallerMemberName] string? memberName = null)
+ {
+ DebugValidateArg(thisOrContextObject);
+ DebugValidateArg(arg0);
+ if (IsEnabled) Log.Enter(IdOf(thisOrContextObject), memberName, $"({Format(arg0)})");
+ }
+
+ /// <summary>Logs entrance to a method.</summary>
+ /// <param name="thisOrContextObject">`this`, or another object that serves to provide context for the operation.</param>
+ /// <param name="arg0">The first object to log.</param>
+ /// <param name="arg1">The second object to log.</param>
+ /// <param name="memberName">The calling member.</param>
+ [NonEvent]
+ public static void Enter(object? thisOrContextObject, object arg0, object arg1, [CallerMemberName] string? memberName = null)
+ {
+ DebugValidateArg(thisOrContextObject);
+ DebugValidateArg(arg0);
+ DebugValidateArg(arg1);
+ if (IsEnabled) Log.Enter(IdOf(thisOrContextObject), memberName, $"({Format(arg0)}, {Format(arg1)})");
+ }
+
+ /// <summary>Logs entrance to a method.</summary>
+ /// <param name="thisOrContextObject">`this`, or another object that serves to provide context for the operation.</param>
+ /// <param name="arg0">The first object to log.</param>
+ /// <param name="arg1">The second object to log.</param>
+ /// <param name="arg2">The third object to log.</param>
+ /// <param name="memberName">The calling member.</param>
+ [NonEvent]
+ public static void Enter(object? thisOrContextObject, object arg0, object arg1, object arg2, [CallerMemberName] string? memberName = null)
+ {
+ DebugValidateArg(thisOrContextObject);
+ DebugValidateArg(arg0);
+ DebugValidateArg(arg1);
+ DebugValidateArg(arg2);
+ if (IsEnabled) Log.Enter(IdOf(thisOrContextObject), memberName, $"({Format(arg0)}, {Format(arg1)}, {Format(arg2)})");
+ }
+
+ [Event(EnterEventId, Level = EventLevel.Informational, Keywords = Keywords.EnterExit)]
+ private void Enter(string thisOrContextObject, string? memberName, string parameters) =>
+ WriteEvent(EnterEventId, thisOrContextObject, memberName ?? MissingMember, parameters);
+ #endregion
+
+ #region Exit
+ /// <summary>Logs exit from a method.</summary>
+ /// <param name="thisOrContextObject">`this`, or another object that serves to provide context for the operation.</param>
+ /// <param name="formattableString">A description of the exit operation, including any return values.</param>
+ /// <param name="memberName">The calling member.</param>
+ [NonEvent]
+ public static void Exit(object? thisOrContextObject, FormattableString? formattableString = null, [CallerMemberName] string? memberName = null)
+ {
+ DebugValidateArg(thisOrContextObject);
+ DebugValidateArg(formattableString);
+ if (IsEnabled) Log.Exit(IdOf(thisOrContextObject), memberName, formattableString != null ? Format(formattableString) : NoParameters);
+ }
+
+ /// <summary>Logs exit from a method.</summary>
+ /// <param name="thisOrContextObject">`this`, or another object that serves to provide context for the operation.</param>
+ /// <param name="arg0">A return value from the member.</param>
+ /// <param name="memberName">The calling member.</param>
+ [NonEvent]
+ public static void Exit(object? thisOrContextObject, object arg0, [CallerMemberName] string? memberName = null)
+ {
+ DebugValidateArg(thisOrContextObject);
+ DebugValidateArg(arg0);
+ if (IsEnabled) Log.Exit(IdOf(thisOrContextObject), memberName, Format(arg0).ToString());
+ }
+
+ /// <summary>Logs exit from a method.</summary>
+ /// <param name="thisOrContextObject">`this`, or another object that serves to provide context for the operation.</param>
+ /// <param name="arg0">A return value from the member.</param>
+ /// <param name="arg1">A second return value from the member.</param>
+ /// <param name="memberName">The calling member.</param>
+ [NonEvent]
+ public static void Exit(object? thisOrContextObject, object arg0, object arg1, [CallerMemberName] string? memberName = null)
+ {
+ DebugValidateArg(thisOrContextObject);
+ DebugValidateArg(arg0);
+ DebugValidateArg(arg1);
+ if (IsEnabled) Log.Exit(IdOf(thisOrContextObject), memberName, $"{Format(arg0)}, {Format(arg1)}");
+ }
+
+ [Event(ExitEventId, Level = EventLevel.Informational, Keywords = Keywords.EnterExit)]
+ private void Exit(string thisOrContextObject, string? memberName, string? result) =>
+ WriteEvent(ExitEventId, thisOrContextObject, memberName ?? MissingMember, result);
+ #endregion
+
+ #region Info
+ /// <summary>Logs an information message.</summary>
+ /// <param name="thisOrContextObject">`this`, or another object that serves to provide context for the operation.</param>
+ /// <param name="formattableString">The message to be logged.</param>
+ /// <param name="memberName">The calling member.</param>
+ [NonEvent]
+ public static void Info(object? thisOrContextObject, FormattableString? formattableString = null, [CallerMemberName] string? memberName = null)
+ {
+ DebugValidateArg(thisOrContextObject);
+ DebugValidateArg(formattableString);
+ if (IsEnabled) Log.Info(IdOf(thisOrContextObject), memberName, formattableString != null ? Format(formattableString) : NoParameters);
+ }
+
+ /// <summary>Logs an information message.</summary>
+ /// <param name="thisOrContextObject">`this`, or another object that serves to provide context for the operation.</param>
+ /// <param name="message">The message to be logged.</param>
+ /// <param name="memberName">The calling member.</param>
+ [NonEvent]
+ public static void Info(object? thisOrContextObject, object? message, [CallerMemberName] string? memberName = null)
+ {
+ DebugValidateArg(thisOrContextObject);
+ DebugValidateArg(message);
+ if (IsEnabled) Log.Info(IdOf(thisOrContextObject), memberName, Format(message).ToString());
+ }
+
+ [Event(InfoEventId, Level = EventLevel.Informational, Keywords = Keywords.Default)]
+ private void Info(string thisOrContextObject, string? memberName, string? message) =>
+ WriteEvent(InfoEventId, thisOrContextObject, memberName ?? MissingMember, message);
+ #endregion
+
+ #region Error
+ /// <summary>Logs an error message.</summary>
+ /// <param name="thisOrContextObject">`this`, or another object that serves to provide context for the operation.</param>
+ /// <param name="formattableString">The message to be logged.</param>
+ /// <param name="memberName">The calling member.</param>
+ [NonEvent]
+ public static void Error(object? thisOrContextObject, FormattableString formattableString, [CallerMemberName] string? memberName = null)
+ {
+ DebugValidateArg(thisOrContextObject);
+ DebugValidateArg(formattableString);
+ if (IsEnabled) Log.ErrorMessage(IdOf(thisOrContextObject), memberName, Format(formattableString));
+ }
+
+ /// <summary>Logs an error message.</summary>
+ /// <param name="thisOrContextObject">`this`, or another object that serves to provide context for the operation.</param>
+ /// <param name="message">The message to be logged.</param>
+ /// <param name="memberName">The calling member.</param>
+ [NonEvent]
+ public static void Error(object? thisOrContextObject, object message, [CallerMemberName] string? memberName = null)
+ {
+ DebugValidateArg(thisOrContextObject);
+ DebugValidateArg(message);
+ if (IsEnabled) Log.ErrorMessage(IdOf(thisOrContextObject), memberName, Format(message).ToString());
+ }
+
+ [Event(ErrorEventId, Level = EventLevel.Error, Keywords = Keywords.Default)]
+ private void ErrorMessage(string thisOrContextObject, string? memberName, string? message) =>
+ WriteEvent(ErrorEventId, thisOrContextObject, memberName ?? MissingMember, message);
+ #endregion
+
+ #region Fail
+ /// <summary>Logs a fatal error and raises an assert.</summary>
+ /// <param name="thisOrContextObject">`this`, or another object that serves to provide context for the operation.</param>
+ /// <param name="formattableString">The message to be logged.</param>
+ /// <param name="memberName">The calling member.</param>
+ [NonEvent]
+ public static void Fail(object? thisOrContextObject, FormattableString formattableString, [CallerMemberName] string? memberName = null)
+ {
+ // Don't call DebugValidateArg on args, as we expect Fail to be used in assert/failure situations
+ // that should never happen in production, and thus we don't care about extra costs.
+
+ if (IsEnabled) Log.CriticalFailure(IdOf(thisOrContextObject), memberName, Format(formattableString));
+ Debug.Fail(Format(formattableString), $"{IdOf(thisOrContextObject)}.{memberName}");
+ }
+
+ /// <summary>Logs a fatal error and raises an assert.</summary>
+ /// <param name="thisOrContextObject">`this`, or another object that serves to provide context for the operation.</param>
+ /// <param name="message">The message to be logged.</param>
+ /// <param name="memberName">The calling member.</param>
+ [NonEvent]
+ public static void Fail(object? thisOrContextObject, object message, [CallerMemberName] string? memberName = null)
+ {
+ // Don't call DebugValidateArg on args, as we expect Fail to be used in assert/failure situations
+ // that should never happen in production, and thus we don't care about extra costs.
+
+ if (IsEnabled) Log.CriticalFailure(IdOf(thisOrContextObject), memberName, Format(message).ToString());
+ Debug.Fail(Format(message).ToString(), $"{IdOf(thisOrContextObject)}.{memberName}");
+ }
+
+ [Event(CriticalFailureEventId, Level = EventLevel.Critical, Keywords = Keywords.Debug)]
+ private void CriticalFailure(string thisOrContextObject, string? memberName, string? message) =>
+ WriteEvent(CriticalFailureEventId, thisOrContextObject, memberName ?? MissingMember, message);
+ #endregion
+
+ #region DumpBuffer
+ /// <summary>Logs the contents of a buffer.</summary>
+ /// <param name="thisOrContextObject">`this`, or another object that serves to provide context for the operation.</param>
+ /// <param name="buffer">The buffer to be logged.</param>
+ /// <param name="memberName">The calling member.</param>
+ [NonEvent]
+ public static void DumpBuffer(object? thisOrContextObject, byte[] buffer, [CallerMemberName] string? memberName = null)
+ {
+ DumpBuffer(thisOrContextObject, buffer, 0, buffer.Length, memberName);
+ }
+
+ /// <summary>Logs the contents of a buffer.</summary>
+ /// <param name="thisOrContextObject">`this`, or another object that serves to provide context for the operation.</param>
+ /// <param name="buffer">The buffer to be logged.</param>
+ /// <param name="offset">The starting offset from which to log.</param>
+ /// <param name="count">The number of bytes to log.</param>
+ /// <param name="memberName">The calling member.</param>
+ [NonEvent]
+ public static void DumpBuffer(object? thisOrContextObject, byte[] buffer, int offset, int count, [CallerMemberName] string? memberName = null)
+ {
+ if (IsEnabled)
+ {
+ if (offset < 0 || offset > buffer.Length - count)
+ {
+ Fail(thisOrContextObject, $"Invalid {nameof(DumpBuffer)} Args. Length={buffer.Length}, Offset={offset}, Count={count}", memberName);
+ return;
+ }
+
+ count = Math.Min(count, MaxDumpSize);
+
+ byte[] slice = buffer;
+ if (offset != 0 || count != buffer.Length)
+ {
+ slice = new byte[count];
+ Buffer.BlockCopy(buffer, offset, slice, 0, count);
+ }
+
+ Log.DumpBuffer(IdOf(thisOrContextObject), memberName, slice);
+ }
+ }
+
+ /// <summary>Logs the contents of a buffer.</summary>
+ /// <param name="thisOrContextObject">`this`, or another object that serves to provide context for the operation.</param>
+ /// <param name="bufferPtr">The starting location of the buffer to be logged.</param>
+ /// <param name="count">The number of bytes to log.</param>
+ /// <param name="memberName">The calling member.</param>
+ [NonEvent]
+ public static unsafe void DumpBuffer(object? thisOrContextObject, IntPtr bufferPtr, int count, [CallerMemberName] string? memberName = null)
+ {
+ Debug.Assert(bufferPtr != IntPtr.Zero);
+ Debug.Assert(count >= 0);
+
+ if (IsEnabled)
+ {
+ var buffer = new byte[Math.Min(count, MaxDumpSize)];
+ fixed (byte* targetPtr = buffer)
+ {
+ Buffer.MemoryCopy((byte*)bufferPtr, targetPtr, buffer.Length, buffer.Length);
+ }
+ Log.DumpBuffer(IdOf(thisOrContextObject), memberName, buffer);
+ }
+ }
+
+ [Event(DumpArrayEventId, Level = EventLevel.Verbose, Keywords = Keywords.Debug)]
+ private unsafe void DumpBuffer(string thisOrContextObject, string? memberName, byte[] buffer) =>
+ WriteEvent(DumpArrayEventId, thisOrContextObject, memberName ?? MissingMember, buffer);
+ #endregion
+
+ #region Associate
+ /// <summary>Logs a relationship between two objects.</summary>
+ /// <param name="first">The first object.</param>
+ /// <param name="second">The second object.</param>
+ /// <param name="memberName">The calling member.</param>
+ [NonEvent]
+ public static void Associate(object first, object second, [CallerMemberName] string? memberName = null)
+ {
+ DebugValidateArg(first);
+ DebugValidateArg(second);
+ if (IsEnabled) Log.Associate(IdOf(first), memberName, IdOf(first), IdOf(second));
+ }
+
+ /// <summary>Logs a relationship between two objects.</summary>
+ /// <param name="thisOrContextObject">`this`, or another object that serves to provide context for the operation.</param>
+ /// <param name="first">The first object.</param>
+ /// <param name="second">The second object.</param>
+ /// <param name="memberName">The calling member.</param>
+ [NonEvent]
+ public static void Associate(object? thisOrContextObject, object first, object second, [CallerMemberName] string? memberName = null)
+ {
+ DebugValidateArg(thisOrContextObject);
+ DebugValidateArg(first);
+ DebugValidateArg(second);
+ if (IsEnabled) Log.Associate(IdOf(thisOrContextObject), memberName, IdOf(first), IdOf(second));
+ }
+
+ [Event(AssociateEventId, Level = EventLevel.Informational, Keywords = Keywords.Default, Message = "[{2}]<-->[{3}]")]
+ private void Associate(string thisOrContextObject, string? memberName, string first, string second) =>
+ WriteEvent(AssociateEventId, thisOrContextObject, memberName ?? MissingMember, first, second);
+ #endregion
+ #endregion
+
+ #region Helpers
+ [Conditional("DEBUG_NETEVENTSOURCE_MISUSE")]
+ private static void DebugValidateArg(object? arg)
+ {
+ if (!IsEnabled)
+ {
+ Debug.Assert(!(arg is ValueType), $"Should not be passing value type {arg?.GetType()} to logging without IsEnabled check");
+ Debug.Assert(!(arg is FormattableString), $"Should not be formatting FormattableString \"{arg}\" if tracing isn't enabled");
+ }
+ }
+
+ [Conditional("DEBUG_NETEVENTSOURCE_MISUSE")]
+ private static void DebugValidateArg(FormattableString? arg)
+ {
+ Debug.Assert(IsEnabled || arg == null, $"Should not be formatting FormattableString \"{arg}\" if tracing isn't enabled");
+ }
+
+ public static new bool IsEnabled =>
+ Log.IsEnabled();
+
+ [NonEvent]
+ public static string IdOf(object? value) => value != null ? value.GetType().Name + "#" + GetHashCode(value) : NullInstance;
+
+ [NonEvent]
+ public static int GetHashCode(object value) => value?.GetHashCode() ?? 0;
+
+ [NonEvent]
+ public static object Format(object? value)
+ {
+ // If it's null, return a known string for null values
+ if (value == null)
+ {
+ return NullInstance;
+ }
+
+ // Give another partial implementation a chance to provide its own string representation
+ string? result = null;
+ AdditionalCustomizedToString(value, ref result);
+ if (result != null)
+ {
+ return result;
+ }
+
+ // Format arrays with their element type name and length
+ if (value is Array arr)
+ {
+ return $"{arr.GetType().GetElementType()}[{((Array)value).Length}]";
+ }
+
+ // Format ICollections as the name and count
+ if (value is ICollection c)
+ {
+ return $"{c.GetType().Name}({c.Count})";
+ }
+
+ // Format SafeHandles as their type, hash code, and pointer value
+ if (value is SafeHandle handle)
+ {
+ return $"{handle.GetType().Name}:{handle.GetHashCode()}(0x{handle.DangerousGetHandle():X})";
+ }
+
+ // Format IntPtrs as hex
+ if (value is IntPtr)
+ {
+ return $"0x{value:X}";
+ }
+
+ // If the string representation of the instance would just be its type name,
+ // use its id instead.
+ string? toString = value.ToString();
+ if (toString == null || toString == value.GetType().FullName)
+ {
+ return IdOf(value);
+ }
+
+ // Otherwise, return the original object so that the caller does default formatting.
+ return value;
+ }
+
+ [NonEvent]
+ private static string Format(FormattableString s)
+ {
+ switch (s.ArgumentCount)
+ {
+ case 0: return s.Format;
+ case 1: return string.Format(s.Format, Format(s.GetArgument(0)));
+ case 2: return string.Format(s.Format, Format(s.GetArgument(0)), Format(s.GetArgument(1)));
+ case 3: return string.Format(s.Format, Format(s.GetArgument(0)), Format(s.GetArgument(1)), Format(s.GetArgument(2)));
+ default:
+ object?[] args = s.GetArguments();
+ object[] formattedArgs = new object[args.Length];
+ for (int i = 0; i < args.Length; i++)
+ {
+ formattedArgs[i] = Format(args[i]);
+ }
+ return string.Format(s.Format, formattedArgs);
+ }
+ }
+
+ static partial void AdditionalCustomizedToString<T>(T value, ref string? result);
+ #endregion
+
+ #region Custom WriteEvent overloads
+
+ [NonEvent]
+ private unsafe void WriteEvent(int eventId, string? arg1, string? arg2, string? arg3, string? arg4)
+ {
+ if (IsEnabled())
+ {
+ if (arg1 == null) arg1 = "";
+ if (arg2 == null) arg2 = "";
+ if (arg3 == null) arg3 = "";
+ if (arg4 == null) arg4 = "";
+
+ fixed (char* string1Bytes = arg1)
+ fixed (char* string2Bytes = arg2)
+ fixed (char* string3Bytes = arg3)
+ fixed (char* string4Bytes = arg4)
+ {
+ const int NumEventDatas = 4;
+ var descrs = stackalloc EventData[NumEventDatas];
+
+ descrs[0] = new EventData
+ {
+ DataPointer = (IntPtr)string1Bytes,
+ Size = ((arg1.Length + 1) * 2)
+ };
+ descrs[1] = new EventData
+ {
+ DataPointer = (IntPtr)string2Bytes,
+ Size = ((arg2.Length + 1) * 2)
+ };
+ descrs[2] = new EventData
+ {
+ DataPointer = (IntPtr)string3Bytes,
+ Size = ((arg3.Length + 1) * 2)
+ };
+ descrs[3] = new EventData
+ {
+ DataPointer = (IntPtr)string4Bytes,
+ Size = ((arg4.Length + 1) * 2)
+ };
+
+ WriteEventCore(eventId, NumEventDatas, descrs);
+ }
+ }
+ }
+
+ [NonEvent]
+ private unsafe void WriteEvent(int eventId, string? arg1, string? arg2, byte[]? arg3)
+ {
+ if (IsEnabled())
+ {
+ if (arg1 == null) arg1 = "";
+ if (arg2 == null) arg2 = "";
+ if (arg3 == null) arg3 = Array.Empty<byte>();
+
+ fixed (char* arg1Ptr = arg1)
+ fixed (char* arg2Ptr = arg2)
+ fixed (byte* arg3Ptr = arg3)
+ {
+ int bufferLength = arg3.Length;
+ const int NumEventDatas = 4;
+ var descrs = stackalloc EventData[NumEventDatas];
+
+ descrs[0] = new EventData
+ {
+ DataPointer = (IntPtr)arg1Ptr,
+ Size = (arg1.Length + 1) * sizeof(char)
+ };
+ descrs[1] = new EventData
+ {
+ DataPointer = (IntPtr)arg2Ptr,
+ Size = (arg2.Length + 1) * sizeof(char)
+ };
+ descrs[2] = new EventData
+ {
+ DataPointer = (IntPtr)(&bufferLength),
+ Size = 4
+ };
+ descrs[3] = new EventData
+ {
+ DataPointer = (IntPtr)arg3Ptr,
+ Size = bufferLength
+ };
+
+ WriteEventCore(eventId, NumEventDatas, descrs);
+ }
+ }
+ }
+
+ [NonEvent]
+ private unsafe void WriteEvent(int eventId, string? arg1, int arg2, int arg3, int arg4)
+ {
+ if (IsEnabled())
+ {
+ if (arg1 == null) arg1 = "";
+
+ fixed (char* arg1Ptr = arg1)
+ {
+ const int NumEventDatas = 4;
+ var descrs = stackalloc EventData[NumEventDatas];
+
+ descrs[0] = new EventData
+ {
+ DataPointer = (IntPtr)(arg1Ptr),
+ Size = (arg1.Length + 1) * sizeof(char)
+ };
+ descrs[1] = new EventData
+ {
+ DataPointer = (IntPtr)(&arg2),
+ Size = sizeof(int)
+ };
+ descrs[2] = new EventData
+ {
+ DataPointer = (IntPtr)(&arg3),
+ Size = sizeof(int)
+ };
+ descrs[3] = new EventData
+ {
+ DataPointer = (IntPtr)(&arg4),
+ Size = sizeof(int)
+ };
+
+ WriteEventCore(eventId, NumEventDatas, descrs);
+ }
+ }
+ }
+
+ [NonEvent]
+ private unsafe void WriteEvent(int eventId, string? arg1, int arg2, string? arg3)
+ {
+ if (IsEnabled())
+ {
+ if (arg1 == null) arg1 = "";
+ if (arg3 == null) arg3 = "";
+
+ fixed (char* arg1Ptr = arg1)
+ fixed (char* arg3Ptr = arg3)
+ {
+ const int NumEventDatas = 3;
+ var descrs = stackalloc EventData[NumEventDatas];
+
+ descrs[0] = new EventData
+ {
+ DataPointer = (IntPtr)(arg1Ptr),
+ Size = (arg1.Length + 1) * sizeof(char)
+ };
+ descrs[1] = new EventData
+ {
+ DataPointer = (IntPtr)(&arg2),
+ Size = sizeof(int)
+ };
+ descrs[2] = new EventData
+ {
+ DataPointer = (IntPtr)(arg3Ptr),
+ Size = (arg3.Length + 1) * sizeof(char)
+ };
+
+ WriteEventCore(eventId, NumEventDatas, descrs);
+ }
+ }
+ }
+
+ [NonEvent]
+ private unsafe void WriteEvent(int eventId, string? arg1, string? arg2, int arg3)
+ {
+ if (IsEnabled())
+ {
+ if (arg1 == null) arg1 = "";
+ if (arg2 == null) arg2 = "";
+
+ fixed (char* arg1Ptr = arg1)
+ fixed (char* arg2Ptr = arg2)
+ {
+ const int NumEventDatas = 3;
+ var descrs = stackalloc EventData[NumEventDatas];
+
+ descrs[0] = new EventData
+ {
+ DataPointer = (IntPtr)(arg1Ptr),
+ Size = (arg1.Length + 1) * sizeof(char)
+ };
+ descrs[1] = new EventData
+ {
+ DataPointer = (IntPtr)(arg2Ptr),
+ Size = (arg2.Length + 1) * sizeof(char)
+ };
+ descrs[2] = new EventData
+ {
+ DataPointer = (IntPtr)(&arg3),
+ Size = sizeof(int)
+ };
+
+ WriteEventCore(eventId, NumEventDatas, descrs);
+ }
+ }
+ }
+
+ [NonEvent]
+ private unsafe void WriteEvent(int eventId, string? arg1, string? arg2, string? arg3, int arg4)
+ {
+ if (IsEnabled())
+ {
+ if (arg1 == null) arg1 = "";
+ if (arg2 == null) arg2 = "";
+ if (arg3 == null) arg3 = "";
+
+ fixed (char* arg1Ptr = arg1)
+ fixed (char* arg2Ptr = arg2)
+ fixed (char* arg3Ptr = arg3)
+ {
+ const int NumEventDatas = 4;
+ var descrs = stackalloc EventData[NumEventDatas];
+
+ descrs[0] = new EventData
+ {
+ DataPointer = (IntPtr)(arg1Ptr),
+ Size = (arg1.Length + 1) * sizeof(char)
+ };
+ descrs[1] = new EventData
+ {
+ DataPointer = (IntPtr)(arg2Ptr),
+ Size = (arg2.Length + 1) * sizeof(char)
+ };
+ descrs[2] = new EventData
+ {
+ DataPointer = (IntPtr)(arg3Ptr),
+ Size = (arg3.Length + 1) * sizeof(char)
+ };
+ descrs[3] = new EventData
+ {
+ DataPointer = (IntPtr)(&arg4),
+ Size = sizeof(int)
+ };
+
+ WriteEventCore(eventId, NumEventDatas, descrs);
+ }
+ }
+ }
+ #endregion
+ }
+}
diff --git a/src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/Mock/MockConnection.cs b/src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Implementations/Mock/MockConnection.cs
index d9ab07022e7..d9ab07022e7 100644
--- a/src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/Mock/MockConnection.cs
+++ b/src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Implementations/Mock/MockConnection.cs
diff --git a/src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/Mock/MockImplementationProvider.cs b/src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Implementations/Mock/MockImplementationProvider.cs
index b70a1132848..b70a1132848 100644
--- a/src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/Mock/MockImplementationProvider.cs
+++ b/src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Implementations/Mock/MockImplementationProvider.cs
diff --git a/src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/Mock/MockListener.cs b/src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Implementations/Mock/MockListener.cs
index 911f1896b16..911f1896b16 100644
--- a/src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/Mock/MockListener.cs
+++ b/src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Implementations/Mock/MockListener.cs
diff --git a/src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/Mock/MockStream.cs b/src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Implementations/Mock/MockStream.cs
index 187ba680e17..187ba680e17 100644
--- a/src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/Mock/MockStream.cs
+++ b/src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Implementations/Mock/MockStream.cs
diff --git a/src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/MsQuic/Internal/MsQuicAddressHelpers.cs b/src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Implementations/MsQuic/Internal/MsQuicAddressHelpers.cs
index 2ecf0eb2106..2ecf0eb2106 100644
--- a/src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/MsQuic/Internal/MsQuicAddressHelpers.cs
+++ b/src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Implementations/MsQuic/Internal/MsQuicAddressHelpers.cs
diff --git a/src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/MsQuic/Internal/MsQuicApi.cs b/src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Implementations/MsQuic/Internal/MsQuicApi.cs
index 30e5cba6cbe..30e5cba6cbe 100644
--- a/src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/MsQuic/Internal/MsQuicApi.cs
+++ b/src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Implementations/MsQuic/Internal/MsQuicApi.cs
diff --git a/src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/MsQuic/Internal/MsQuicParameterHelpers.cs b/src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Implementations/MsQuic/Internal/MsQuicParameterHelpers.cs
index 757bb0da054..757bb0da054 100644
--- a/src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/MsQuic/Internal/MsQuicParameterHelpers.cs
+++ b/src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Implementations/MsQuic/Internal/MsQuicParameterHelpers.cs
diff --git a/src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/MsQuic/Internal/MsQuicSecurityConfig.cs b/src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Implementations/MsQuic/Internal/MsQuicSecurityConfig.cs
index 58fc811f7cf..58fc811f7cf 100644
--- a/src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/MsQuic/Internal/MsQuicSecurityConfig.cs
+++ b/src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Implementations/MsQuic/Internal/MsQuicSecurityConfig.cs
diff --git a/src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/MsQuic/Internal/MsQuicSession.cs b/src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Implementations/MsQuic/Internal/MsQuicSession.cs
index 89dd99f73c3..89dd99f73c3 100644
--- a/src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/MsQuic/Internal/MsQuicSession.cs
+++ b/src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Implementations/MsQuic/Internal/MsQuicSession.cs
diff --git a/src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/MsQuic/Internal/QuicExceptionHelpers.cs b/src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Implementations/MsQuic/Internal/QuicExceptionHelpers.cs
index 1b8ab8ef260..1b8ab8ef260 100644
--- a/src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/MsQuic/Internal/QuicExceptionHelpers.cs
+++ b/src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Implementations/MsQuic/Internal/QuicExceptionHelpers.cs
diff --git a/src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/MsQuic/Internal/ResettableCompletionSource.cs b/src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Implementations/MsQuic/Internal/ResettableCompletionSource.cs
index 1db5dc67b4c..1db5dc67b4c 100644
--- a/src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/MsQuic/Internal/ResettableCompletionSource.cs
+++ b/src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Implementations/MsQuic/Internal/ResettableCompletionSource.cs
diff --git a/src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/MsQuic/MsQuicConnection.cs b/src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Implementations/MsQuic/MsQuicConnection.cs
index 1d914c2668e..1d914c2668e 100644
--- a/src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/MsQuic/MsQuicConnection.cs
+++ b/src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Implementations/MsQuic/MsQuicConnection.cs
diff --git a/src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/MsQuic/MsQuicImplementationProvider.cs b/src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Implementations/MsQuic/MsQuicImplementationProvider.cs
index 55c5e524ec5..55c5e524ec5 100644
--- a/src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/MsQuic/MsQuicImplementationProvider.cs
+++ b/src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Implementations/MsQuic/MsQuicImplementationProvider.cs
diff --git a/src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/MsQuic/MsQuicListener.cs b/src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Implementations/MsQuic/MsQuicListener.cs
index 20d677a9b92..14323d963f3 100644
--- a/src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/MsQuic/MsQuicListener.cs
+++ b/src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Implementations/MsQuic/MsQuicListener.cs
@@ -170,9 +170,8 @@ namespace System.Net.Quic.Implementations.MsQuic
return MsQuicStatusCodes.InternalError;
}
}
- catch (Exception ex)
+ catch (Exception)
{
- Console.WriteLine(ex.Message);
return MsQuicStatusCodes.InternalError;
}
}
diff --git a/src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/MsQuic/MsQuicStream.cs b/src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Implementations/MsQuic/MsQuicStream.cs
index 536968b55cd..536968b55cd 100644
--- a/src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/MsQuic/MsQuicStream.cs
+++ b/src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Implementations/MsQuic/MsQuicStream.cs
diff --git a/src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/QuicConnectionProvider.cs b/src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Implementations/QuicConnectionProvider.cs
index d77bf1df76f..d77bf1df76f 100644
--- a/src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/QuicConnectionProvider.cs
+++ b/src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Implementations/QuicConnectionProvider.cs
diff --git a/src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/QuicImplementationProvider.cs b/src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Implementations/QuicImplementationProvider.cs
index 683a752e20a..906f4562667 100644
--- a/src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/QuicImplementationProvider.cs
+++ b/src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Implementations/QuicImplementationProvider.cs
@@ -6,7 +6,7 @@ using System.Net.Security;
namespace System.Net.Quic.Implementations
{
- public abstract class QuicImplementationProvider
+ internal abstract class QuicImplementationProvider
{
internal QuicImplementationProvider() { }
diff --git a/src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/QuicListenerProvider.cs b/src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Implementations/QuicListenerProvider.cs
index f533a8bb381..f533a8bb381 100644
--- a/src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/QuicListenerProvider.cs
+++ b/src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Implementations/QuicListenerProvider.cs
diff --git a/src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/QuicStreamProvider.cs b/src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Implementations/QuicStreamProvider.cs
index 1e96e1597ac..1e96e1597ac 100644
--- a/src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/QuicStreamProvider.cs
+++ b/src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Implementations/QuicStreamProvider.cs
diff --git a/src/libraries/System.Net.Quic/src/Interop/Interop.MsQuic.cs b/src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Interop/Interop.MsQuic.cs
index 25a5e577551..25a5e577551 100644
--- a/src/libraries/System.Net.Quic/src/Interop/Interop.MsQuic.cs
+++ b/src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Interop/Interop.MsQuic.cs
diff --git a/src/libraries/System.Net.Quic/src/Interop/MsQuicEnums.cs b/src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Interop/MsQuicEnums.cs
index 3d294bce9c8..3d294bce9c8 100644
--- a/src/libraries/System.Net.Quic/src/Interop/MsQuicEnums.cs
+++ b/src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Interop/MsQuicEnums.cs
diff --git a/src/libraries/System.Net.Quic/src/Interop/MsQuicNativeMethods.cs b/src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Interop/MsQuicNativeMethods.cs
index aca6b41a580..aca6b41a580 100644
--- a/src/libraries/System.Net.Quic/src/Interop/MsQuicNativeMethods.cs
+++ b/src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Interop/MsQuicNativeMethods.cs
diff --git a/src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Interop/MsQuicStatusCodes.cs b/src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Interop/MsQuicStatusCodes.cs
new file mode 100644
index 00000000000..72c35687ebe
--- /dev/null
+++ b/src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Interop/MsQuicStatusCodes.cs
@@ -0,0 +1,121 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using System.Runtime.InteropServices;
+
+namespace System.Net.Quic.Implementations.MsQuic.Internal
+{
+ internal static class MsQuicStatusCodes
+ {
+ internal static readonly uint Success = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? Windows.Success : Linux.Success;
+ internal static readonly uint Pending = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? Windows.Pending : Linux.Pending;
+ internal static readonly uint InternalError = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? Windows.InternalError : Linux.InternalError;
+
+ // TODO return better error messages here.
+ public static string GetError(uint status)
+ {
+ return RuntimeInformation.IsOSPlatform(OSPlatform.Windows)
+ ? Windows.GetError(status) : Linux.GetError(status);
+ }
+
+ private static class Windows
+ {
+ internal const uint Success = 0;
+ internal const uint Pending = 0x703E5;
+ internal const uint Continue = 0x704DE;
+ internal const uint OutOfMemory = 0x8007000E;
+ internal const uint InvalidParameter = 0x80070057;
+ internal const uint InvalidState = 0x8007139F;
+ internal const uint NotSupported = 0x80004002;
+ internal const uint NotFound = 0x80070490;
+ internal const uint BufferTooSmall = 0x8007007A;
+ internal const uint HandshakeFailure = 0x80410000;
+ internal const uint Aborted = 0x80004004;
+ internal const uint AddressInUse = 0x80072740;
+ internal const uint ConnectionTimeout = 0x800704CF;
+ internal const uint ConnectionIdle = 0x800704D4;
+ internal const uint InternalError = 0x80004005;
+ internal const uint ServerBusy = 0x800704C9;
+ internal const uint ProtocolError = 0x800704CD;
+ internal const uint HostUnreachable = 0x800704D0;
+ internal const uint VerNegError = 0x80410001;
+
+ // TODO return better error messages here.
+ public static string GetError(uint status)
+ {
+ return status switch
+ {
+ Success => "SUCCESS",
+ Pending => "PENDING",
+ Continue => "CONTINUE",
+ OutOfMemory => "OUT_OF_MEMORY",
+ InvalidParameter => "INVALID_PARAMETER",
+ InvalidState => "INVALID_STATE",
+ NotSupported => "NOT_SUPPORTED",
+ NotFound => "NOT_FOUND",
+ BufferTooSmall => "BUFFER_TOO_SMALL",
+ HandshakeFailure => "HANDSHAKE_FAILURE",
+ Aborted => "ABORTED",
+ AddressInUse => "ADDRESS_IN_USE",
+ ConnectionTimeout => "CONNECTION_TIMEOUT",
+ ConnectionIdle => "CONNECTION_IDLE",
+ InternalError => "INTERNAL_ERROR",
+ ServerBusy => "SERVER_BUSY",
+ ProtocolError => "PROTOCOL_ERROR",
+ VerNegError => "VER_NEG_ERROR",
+ _ => status.ToString()
+ };
+ }
+ }
+
+ private static class Linux
+ {
+ internal const uint Success = 0;
+ internal const uint Pending = unchecked((uint)-2);
+ internal const uint Continue = unchecked((uint)-1);
+ internal const uint OutOfMemory = 12;
+ internal const uint InvalidParameter = 22;
+ internal const uint InvalidState = 200000002;
+ internal const uint NotSupported = 95;
+ internal const uint NotFound = 2;
+ internal const uint BufferTooSmall = 75;
+ internal const uint HandshakeFailure = 200000009;
+ internal const uint Aborted = 200000008;
+ internal const uint AddressInUse = 98;
+ internal const uint ConnectionTimeout = 110;
+ internal const uint ConnectionIdle = 200000011;
+ internal const uint InternalError = 200000012;
+ internal const uint ServerBusy = 200000007;
+ internal const uint ProtocolError = 200000013;
+ internal const uint VerNegError = 200000014;
+
+ // TODO return better error messages here.
+ public static string GetError(uint status)
+ {
+ return status switch
+ {
+ Success => "SUCCESS",
+ Pending => "PENDING",
+ Continue => "CONTINUE",
+ OutOfMemory => "OUT_OF_MEMORY",
+ InvalidParameter => "INVALID_PARAMETER",
+ InvalidState => "INVALID_STATE",
+ NotSupported => "NOT_SUPPORTED",
+ NotFound => "NOT_FOUND",
+ BufferTooSmall => "BUFFER_TOO_SMALL",
+ HandshakeFailure => "HANDSHAKE_FAILURE",
+ Aborted => "ABORTED",
+ AddressInUse => "ADDRESS_IN_USE",
+ ConnectionTimeout => "CONNECTION_TIMEOUT",
+ ConnectionIdle => "CONNECTION_IDLE",
+ InternalError => "INTERNAL_ERROR",
+ ServerBusy => "SERVER_BUSY",
+ ProtocolError => "PROTOCOL_ERROR",
+ VerNegError => "VER_NEG_ERROR",
+ _ => status.ToString()
+ };
+ }
+ }
+ }
+}
diff --git a/src/libraries/System.Net.Quic/src/Interop/Linux/MsQuicStatusHelper.cs b/src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Interop/MsQuicStatusHelper.cs
index 7c49a8f65ad..f08eb861d2e 100644
--- a/src/libraries/System.Net.Quic/src/Interop/Linux/MsQuicStatusHelper.cs
+++ b/src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Interop/MsQuicStatusHelper.cs
@@ -1,4 +1,4 @@
-// Licensed to the .NET Foundation under one or more agreements.
+// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
@@ -10,7 +10,17 @@ namespace System.Net.Quic.Implementations.MsQuic.Internal
{
internal static bool SuccessfulStatusCode(uint status)
{
- return (int)status <= 0;
+ if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
+ {
+ return status < 0x80000000;
+ }
+
+ if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
+ {
+ return (int)status <= 0;
+ }
+
+ return false;
}
}
}
diff --git a/src/libraries/System.Net.Quic/src/System/Net/Quic/NetEventSource.Quic.cs b/src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/NetEventSource.Quic.cs
index 921808829dc..921808829dc 100644
--- a/src/libraries/System.Net.Quic/src/System/Net/Quic/NetEventSource.Quic.cs
+++ b/src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/NetEventSource.Quic.cs
diff --git a/src/libraries/System.Net.Quic/src/System/Net/Quic/QuicClientConnectionOptions.cs b/src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/QuicClientConnectionOptions.cs
index 17270a4de74..a9a9b0ec40c 100644
--- a/src/libraries/System.Net.Quic/src/System/Net/Quic/QuicClientConnectionOptions.cs
+++ b/src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/QuicClientConnectionOptions.cs
@@ -9,7 +9,7 @@ namespace System.Net.Quic
/// <summary>
/// Options to provide to the <see cref="QuicConnection"/> when connecting to a Listener.
/// </summary>
- public class QuicClientConnectionOptions
+ internal class QuicClientConnectionOptions
{
/// <summary>
/// Client authentication options to use when establishing a <see cref="QuicConnection"/>.
diff --git a/src/libraries/System.Net.Quic/src/System/Net/Quic/QuicConnection.cs b/src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/QuicConnection.cs
index 20a63b255d2..877421a94f0 100644
--- a/src/libraries/System.Net.Quic/src/System/Net/Quic/QuicConnection.cs
+++ b/src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/QuicConnection.cs
@@ -10,7 +10,7 @@ using System.Threading.Tasks;
namespace System.Net.Quic
{
- public sealed class QuicConnection : IDisposable
+ internal sealed class QuicConnection : IDisposable
{
private readonly QuicConnectionProvider _provider;
diff --git a/src/libraries/System.Net.Quic/src/System/Net/Quic/QuicConnectionAbortedException.cs b/src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/QuicConnectionAbortedException.cs
index b974881f2b2..41f4b329983 100644
--- a/src/libraries/System.Net.Quic/src/System/Net/Quic/QuicConnectionAbortedException.cs
+++ b/src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/QuicConnectionAbortedException.cs
@@ -4,7 +4,7 @@
namespace System.Net.Quic
{
- public class QuicConnectionAbortedException : QuicException
+ internal class QuicConnectionAbortedException : QuicException
{
internal QuicConnectionAbortedException(long errorCode)
: this(SR.Format(SR.net_quic_connectionaborted, errorCode), errorCode)
diff --git a/src/libraries/System.Net.Quic/src/System/Net/Quic/QuicException.cs b/src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/QuicException.cs
index b84bc1b6aae..843c2f75924 100644
--- a/src/libraries/System.Net.Quic/src/System/Net/Quic/QuicException.cs
+++ b/src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/QuicException.cs
@@ -4,7 +4,7 @@
namespace System.Net.Quic
{
- public class QuicException : Exception
+ internal class QuicException : Exception
{
public QuicException(string message)
: base (message)
diff --git a/src/libraries/System.Net.Quic/src/System/Net/Quic/QuicImplementationProviders.cs b/src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/QuicImplementationProviders.cs
index e3490d29498..66a7e0d6dfb 100644
--- a/src/libraries/System.Net.Quic/src/System/Net/Quic/QuicImplementationProviders.cs
+++ b/src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/QuicImplementationProviders.cs
@@ -4,7 +4,7 @@
namespace System.Net.Quic
{
- public static class QuicImplementationProviders
+ internal static class QuicImplementationProviders
{
public static Implementations.QuicImplementationProvider Mock { get; } = new Implementations.Mock.MockImplementationProvider();
public static Implementations.QuicImplementationProvider MsQuic { get; } = new Implementations.MsQuic.MsQuicImplementationProvider();
diff --git a/src/libraries/System.Net.Quic/src/System/Net/Quic/QuicListener.cs b/src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/QuicListener.cs
index b642b9da1e3..8fb0c1e3375 100644
--- a/src/libraries/System.Net.Quic/src/System/Net/Quic/QuicListener.cs
+++ b/src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/QuicListener.cs
@@ -9,7 +9,7 @@ using System.Threading.Tasks;
namespace System.Net.Quic
{
- public sealed class QuicListener : IDisposable
+ internal sealed class QuicListener : IDisposable
{
private readonly QuicListenerProvider _provider;
diff --git a/src/libraries/System.Net.Quic/src/System/Net/Quic/QuicListenerOptions.cs b/src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/QuicListenerOptions.cs
index f3159457e7e..f9eae30c3d5 100644
--- a/src/libraries/System.Net.Quic/src/System/Net/Quic/QuicListenerOptions.cs
+++ b/src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/QuicListenerOptions.cs
@@ -9,7 +9,7 @@ namespace System.Net.Quic
/// <summary>
/// Options to provide to the <see cref="QuicListener"/>.
/// </summary>
- public class QuicListenerOptions
+ internal class QuicListenerOptions
{
/// <summary>
/// Server Ssl options to use for ALPN, SNI, etc.
diff --git a/src/libraries/System.Net.Quic/src/System/Net/Quic/QuicOperationAbortedException.cs b/src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/QuicOperationAbortedException.cs
index 1dbdd17d9b4..25cd145ee65 100644
--- a/src/libraries/System.Net.Quic/src/System/Net/Quic/QuicOperationAbortedException.cs
+++ b/src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/QuicOperationAbortedException.cs
@@ -4,7 +4,7 @@
namespace System.Net.Quic
{
- public class QuicOperationAbortedException : QuicException
+ internal class QuicOperationAbortedException : QuicException
{
internal QuicOperationAbortedException()
: base(SR.net_quic_operationaborted)
diff --git a/src/libraries/System.Net.Quic/src/System/Net/Quic/QuicStream.cs b/src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/QuicStream.cs
index 55247849d75..6e52bb07530 100644
--- a/src/libraries/System.Net.Quic/src/System/Net/Quic/QuicStream.cs
+++ b/src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/QuicStream.cs
@@ -10,7 +10,7 @@ using System.Threading.Tasks;
namespace System.Net.Quic
{
- public sealed class QuicStream : Stream
+ internal sealed class QuicStream : Stream
{
private readonly QuicStreamProvider _provider;
diff --git a/src/libraries/System.Net.Quic/src/System/Net/Quic/QuicStreamAbortedException.cs b/src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/QuicStreamAbortedException.cs
index 7df666222eb..6e25335f999 100644
--- a/src/libraries/System.Net.Quic/src/System/Net/Quic/QuicStreamAbortedException.cs
+++ b/src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/QuicStreamAbortedException.cs
@@ -4,7 +4,7 @@
namespace System.Net.Quic
{
- public class QuicStreamAbortedException : QuicException
+ internal class QuicStreamAbortedException : QuicException
{
internal QuicStreamAbortedException(long errorCode)
: this(SR.Format(SR.net_quic_streamaborted, errorCode), errorCode)
diff --git a/src/libraries/Common/src/System/Net/Http/aspnetcore/SR.Quic.cs b/src/libraries/Common/src/System/Net/Http/aspnetcore/SR.Quic.cs
new file mode 100644
index 00000000000..6a756f9ca6f
--- /dev/null
+++ b/src/libraries/Common/src/System/Net/Http/aspnetcore/SR.Quic.cs
@@ -0,0 +1,20 @@
+// Copyright (c) .NET Foundation. All rights reserved.
+// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+namespace System.Net.Quic
+{
+ internal static partial class SR
+ {
+ // The resource generator used in AspNetCore does not create this method. This file fills in that functional gap
+ // so we don't have to modify the shared source.
+ internal static string Format(string resourceFormat, params object[] args)
+ {
+ if (args != null)
+ {
+ return string.Format(resourceFormat, args);
+ }
+
+ return resourceFormat;
+ }
+ }
+}
diff --git a/src/libraries/Common/src/System/Net/Http/aspnetcore/SR.resx b/src/libraries/Common/src/System/Net/Http/aspnetcore/SR.resx
index bcd721a2c5f..c6c8b9bd5b2 100644
--- a/src/libraries/Common/src/System/Net/Http/aspnetcore/SR.resx
+++ b/src/libraries/Common/src/System/Net/Http/aspnetcore/SR.resx
@@ -156,4 +156,16 @@
<data name="net_http_request_invalid_char_encoding" xml:space="preserve">
<value>Request headers must contain only ASCII characters.</value>
</data>
+ <data name="net_quic_connectionaborted" xml:space="preserve">
+ <value>Connection aborted by peer ({0}).</value>
+ </data>
+ <data name="net_quic_notsupported" xml:space="preserve">
+ <value>QUIC is not supported on this platform. See http://aka.ms/dotnetquic</value>
+ </data>
+ <data name="net_quic_operationaborted" xml:space="preserve">
+ <value>Operation aborted.</value>
+ </data>
+ <data name="net_quic_streamaborted" xml:space="preserve">
+ <value>Stream aborted by peer ({0}).</value>
+ </data>
</root> \ No newline at end of file
diff --git a/src/libraries/Common/tests/Common.Tests.csproj b/src/libraries/Common/tests/Common.Tests.csproj
index 2d094017848..85bcb69323b 100644
--- a/src/libraries/Common/tests/Common.Tests.csproj
+++ b/src/libraries/Common/tests/Common.Tests.csproj
@@ -1,9 +1,9 @@
-<Project Sdk="Microsoft.NET.Sdk">
+<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<CoverageSupported>false</CoverageSupported>
<IncludeRemoteExecutor>true</IncludeRemoteExecutor>
- <TargetFrameworks>$(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Unix</TargetFrameworks>
+ <TargetFrameworks>$(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Linux;$(NetCoreAppCurrent)-OSX</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<Compile Include="$(CommonTestPath)System\Collections\DictionaryExtensions.cs">
@@ -93,6 +93,111 @@
<Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Http2\Hpack\StatusCodes.cs">
<Link>Common\System\Net\Http\aspnetcore\Http2\Hpack\StatusCodes.cs</Link>
</Compile>
+ <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\Internal\MsQuicAddressHelpers.cs">
+ <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\Internal\MsQuicAddressHelpers.cs</Link>
+ </Compile>
+ <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\Internal\MsQuicApi.cs">
+ <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\Internal\MsQuicApi.cs</Link>
+ </Compile>
+ <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\Internal\MsQuicParameterHelpers.cs">
+ <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\Internal\MsQuicParameterHelpers.cs</Link>
+ </Compile>
+ <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\Internal\MsQuicSecurityConfig.cs">
+ <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\Internal\MsQuicSecurityConfig.cs</Link>
+ </Compile>
+ <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\Internal\MsQuicSession.cs">
+ <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\Internal\MsQuicSession.cs</Link>
+ </Compile>
+ <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\Internal\QuicExceptionHelpers.cs">
+ <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\Internal\QuicExceptionHelpers.cs</Link>
+ </Compile>
+ <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\Internal\ResettableCompletionSource.cs">
+ <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\Internal\ResettableCompletionSource.cs</Link>
+ </Compile>
+ <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\MsQuicConnection.cs">
+ <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\MsQuicConnection.cs</Link>
+ </Compile>
+ <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\MsQuicImplementationProvider.cs">
+ <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\MsQuicImplementationProvider.cs</Link>
+ </Compile>
+ <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\MsQuicListener.cs">
+ <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\MsQuicListener.cs</Link>
+ </Compile>
+ <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\MsQuicStream.cs">
+ <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\MsQuicStream.cs</Link>
+ </Compile>
+ <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\QuicImplementationProvider.cs">
+ <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\QuicImplementationProvider.cs</Link>
+ </Compile>
+ <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\QuicListenerProvider.cs">
+ <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\QuicListenerProvider.cs</Link>
+ </Compile>
+ <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\QuicConnectionProvider.cs">
+ <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\QuicConnectionProvider.cs</Link>
+ </Compile>
+ <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\QuicStreamProvider.cs">
+ <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\QuicStreamProvider.cs</Link>
+ </Compile>
+ <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\Mock\MockImplementationProvider.cs">
+ <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\Mock\MockImplementationProvider.cs</Link>
+ </Compile>
+ <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\Mock\MockListener.cs">
+ <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\Mock\MockListener.cs</Link>
+ </Compile>
+ <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\Mock\MockConnection.cs">
+ <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\Mock\MockConnection.cs</Link>
+ </Compile>
+ <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\Mock\MockStream.cs">
+ <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\Mock\MockStream.cs</Link>
+ </Compile>
+ <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\NetEventSource.Quic.cs" >
+ <Link>Common\System\Net\Http\aspnetcore\Quic\NetEventSource.Quic.cs</Link>
+ </Compile>
+ <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\QuicClientConnectionOptions.cs">
+ <Link>Common\System\Net\Http\aspnetcore\Quic\QuicClientConnectionOptions.cs</Link>
+ </Compile>
+ <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\QuicImplementationProviders.cs">
+ <Link>Common\System\Net\Http\aspnetcore\Quic\QuicImplementationProviders.cs</Link>
+ </Compile>
+ <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\QuicConnection.cs">
+ <Link>Common\System\Net\Http\aspnetcore\Quic\QuicConnection.cs</Link>
+ </Compile>
+ <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\QuicListener.cs">
+ <Link>Common\System\Net\Http\aspnetcore\Quic\QuicListener.cs</Link>
+ </Compile>
+ <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\QuicListenerOptions.cs">
+ <Link>Common\System\Net\Http\aspnetcore\Quic\QuicListenerOptions.cs</Link>
+ </Compile>
+ <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\QuicOperationAbortedException.cs">
+ <Link>Common\System\Net\Http\aspnetcore\Quic\QuicOperationAbortedException.cs</Link>
+ </Compile>
+ <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\QuicStream.cs">
+ <Link>Common\System\Net\Http\aspnetcore\Quic\QuicStream.cs</Link>
+ </Compile>
+ <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\QuicException.cs">
+ <Link>Common\System\Net\Http\aspnetcore\Quic\QuicException.cs</Link>
+ </Compile>
+ <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\QuicConnectionAbortedException.cs">
+ <Link>Common\System\Net\Http\aspnetcore\Quic\QuicConnectionAbortedException.cs</Link>
+ </Compile>
+ <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\QuicStreamAbortedException.cs">
+ <Link>Common\System\Net\Http\aspnetcore\Quic\QuicStreamAbortedException.cs</Link>
+ </Compile>
+ <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Interop\Interop.MsQuic.cs">
+ <Link>Common\System\Net\Http\aspnetcore\Quic\Interop\Interop.MsQuic.cs</Link>
+ </Compile>
+ <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Interop\MsQuicEnums.cs">
+ <Link>Common\System\Net\Http\aspnetcore\Quic\Interop\MsQuicEnums.cs</Link>
+ </Compile>
+ <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Interop\MsQuicNativeMethods.cs">
+ <Link>Common\System\Net\Http\aspnetcore\Quic\Interop\MsQuicNativeMethods.cs</Link>
+ </Compile>
+ <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Interop\MsQuicStatusCodes.cs">
+ <Link>Common\System\Net\Http\aspnetcore\Quic\Interop\MsQuicStatusCodes.cs</Link>
+ </Compile>
+ <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Interop\MsQuicStatusHelper.cs">
+ <Link>Common\System\Net\Http\aspnetcore\Quic\Interop\MsQuicStatusHelper.cs</Link>
+ </Compile>
<Compile Include="$(CommonPath)System\Text\ReusableTextReader.cs">
<Link>Common\System\Text\ReusableTextReader.cs</Link>
</Compile>
@@ -139,6 +244,9 @@
</Compile>
<Compile Include="Tests\System\Net\VirtualNetworkTest.cs" />
<Compile Include="Tests\System\Net\VirtualNetworkStreamTest.cs" />
+ <Compile Include="$(CommonPath)System\Net\Logging\NetEventSource.Common.cs">
+ <Link>Common\System\Net\Logging\NetEventSource.Common.cs</Link>
+ </Compile>
<Compile Include="$(CommonPath)System\Threading\Tasks\TaskToApm.cs">
<Link>Common\System\Threading\Tasks\TaskToApm.cs</Link>
</Compile>
@@ -183,6 +291,18 @@
<Link>System\PasteArguments.Unix.cs</Link>
</Compile>
</ItemGroup>
+ <!-- Linux specific files -->
+ <ItemGroup Condition="'$(TargetsLinux)' == 'true' ">
+ <Compile Include="$(CommonPath)Interop\Linux\Interop.Libraries.cs">
+ <Link>Common\Interop\Linux\Interop.Libraries.cs</Link>
+ </Compile>
+ </ItemGroup>
+ <!-- OSX specific files -->
+ <ItemGroup Condition=" '$(TargetsOSX)' == 'true' ">
+ <Compile Include="$(CommonPath)Interop\OSX\Interop.Libraries.cs">
+ <Link>Common\Interop\OSX\Interop.Libraries.cs</Link>
+ </Compile>
+ </ItemGroup>
<ItemGroup>
<Folder Include="CommonTest\System\" />
<Folder Include="Common\System\Security\Cryptography\" />
diff --git a/src/libraries/Common/tests/Resources/Strings.resx b/src/libraries/Common/tests/Resources/Strings.resx
index 0b406055a82..06f60192aba 100644
--- a/src/libraries/Common/tests/Resources/Strings.resx
+++ b/src/libraries/Common/tests/Resources/Strings.resx
@@ -195,4 +195,16 @@
<data name="net_http_request_invalid_char_encoding" xml:space="preserve">
<value>Request headers must contain only ASCII characters.</value>
</data>
+ <data name="net_quic_connectionaborted" xml:space="preserve">
+ <value>Connection aborted by peer ({0}).</value>
+ </data>
+ <data name="net_quic_notsupported" xml:space="preserve">
+ <value>QUIC is not supported on this platform. See http://aka.ms/dotnetquic</value>
+ </data>
+ <data name="net_quic_operationaborted" xml:space="preserve">
+ <value>Operation aborted.</value>
+ </data>
+ <data name="net_quic_streamaborted" xml:space="preserve">
+ <value>Stream aborted by peer ({0}).</value>
+ </data>
</root> \ No newline at end of file
diff --git a/src/libraries/Common/tests/System/Net/Http/Http3LoopbackConnection.cs b/src/libraries/Common/tests/System/Net/Http/Http3LoopbackConnection.cs
index ac2e4347e93..ca8b78d9ca4 100644
--- a/src/libraries/Common/tests/System/Net/Http/Http3LoopbackConnection.cs
+++ b/src/libraries/Common/tests/System/Net/Http/Http3LoopbackConnection.cs
@@ -12,7 +12,7 @@ using System.Linq;
namespace System.Net.Test.Common
{
- public sealed class Http3LoopbackConnection : GenericLoopbackConnection
+ internal sealed class Http3LoopbackConnection : GenericLoopbackConnection
{
public const long H3_NO_ERROR = 0x100;
public const long H3_GENERAL_PROTOCOL_ERROR = 0x101;
diff --git a/src/libraries/Common/tests/System/Net/Http/Http3LoopbackStream.cs b/src/libraries/Common/tests/System/Net/Http/Http3LoopbackStream.cs
index ad6ded10257..e9cc4489424 100644
--- a/src/libraries/Common/tests/System/Net/Http/Http3LoopbackStream.cs
+++ b/src/libraries/Common/tests/System/Net/Http/Http3LoopbackStream.cs
@@ -13,7 +13,7 @@ using System.Threading.Tasks;
namespace System.Net.Test.Common
{
- public sealed class Http3LoopbackStream : IDisposable
+ internal sealed class Http3LoopbackStream : IDisposable
{
private const int MaximumVarIntBytes = 8;
private const long VarIntMax = (1L << 62) - 1;
diff --git a/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTestBase.cs b/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTestBase.cs
index 49b20767e46..83308747801 100644
--- a/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTestBase.cs
+++ b/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTestBase.cs
@@ -52,7 +52,9 @@ namespace System.Net.Http.Functional.Tests
return useVersion.Major switch
{
#if NETCOREAPP
+#if HTTP3
3 => Http3LoopbackServerFactory.Singleton,
+#endif
2 => Http2LoopbackServerFactory.Singleton,
#endif
_ => Http11LoopbackServerFactory.Singleton
diff --git a/src/libraries/System.Net.Http.WinHttpHandler/tests/FunctionalTests/System.Net.Http.WinHttpHandler.Functional.Tests.csproj b/src/libraries/System.Net.Http.WinHttpHandler/tests/FunctionalTests/System.Net.Http.WinHttpHandler.Functional.Tests.csproj
index e31bec62d26..82e2835aa89 100644
--- a/src/libraries/System.Net.Http.WinHttpHandler/tests/FunctionalTests/System.Net.Http.WinHttpHandler.Functional.Tests.csproj
+++ b/src/libraries/System.Net.Http.WinHttpHandler/tests/FunctionalTests/System.Net.Http.WinHttpHandler.Functional.Tests.csproj
@@ -91,15 +91,6 @@
<Compile Include="$(CommonTestPath)System\Net\Http\QPackTestEncoder.cs">
<Link>Common\System\Net\Http\QPackTestEncoder.cs</Link>
</Compile>
- <Compile Include="$(CommonTestPath)System\Net\Http\Http3LoopbackServer.cs">
- <Link>Common\System\Net\Http\Http3LoopbackServer.cs</Link>
- </Compile>
- <Compile Include="$(CommonTestPath)System\Net\Http\Http3LoopbackConnection.cs">
- <Link>Common\System\Net\Http\Http3LoopbackConnection.cs</Link>
- </Compile>
- <Compile Include="$(CommonTestPath)System\Net\Http\Http3LoopbackStream.cs">
- <Link>Common\System\Net\Http\Http3LoopbackStream.cs</Link>
- </Compile>
<Compile Include="$(CommonTestPath)System\Net\Http\HuffmanDecoder.cs">
<Link>Common\System\Net\Http\HuffmanDecoder.cs</Link>
</Compile>
diff --git a/src/libraries/System.Net.Quic/src/PInvokeAnalyzerExceptionList.analyzerdata b/src/libraries/System.Net.Http/src/PInvokeAnalyzerExceptionList.analyzerdata
index 37203114ff9..37203114ff9 100644
--- a/src/libraries/System.Net.Quic/src/PInvokeAnalyzerExceptionList.analyzerdata
+++ b/src/libraries/System.Net.Http/src/PInvokeAnalyzerExceptionList.analyzerdata
diff --git a/src/libraries/System.Net.Quic/src/Resources/Strings.resx b/src/libraries/System.Net.Http/src/Resources/SR.resx
index fbcfaf651d6..bcd721a2c5f 100644
--- a/src/libraries/System.Net.Quic/src/Resources/Strings.resx
+++ b/src/libraries/System.Net.Http/src/Resources/SR.resx
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
@@ -117,16 +117,43 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
- <data name="net_quic_connectionaborted" xml:space="preserve">
- <value>Connection aborted by peer ({0}).</value>
+ <data name="net_http_headers_exceeded_length" xml:space="preserve">
+ <value>The HTTP headers length exceeded the set limit of {0} bytes.</value>
</data>
- <data name="net_quic_notsupported" xml:space="preserve">
- <value>QUIC is not supported on this platform. See http://aka.ms/dotnetquic</value>
+ <data name="net_http_headers_invalid_header_name" xml:space="preserve">
+ <value>The header name format is invalid.</value>
</data>
- <data name="net_quic_operationaborted" xml:space="preserve">
- <value>Operation aborted.</value>
+ <data name="net_http_hpack_bad_integer" xml:space="preserve">
+ <value>HPACK integer exceeds limits or has an overlong encoding.</value>
</data>
- <data name="net_quic_streamaborted" xml:space="preserve">
- <value>Stream aborted by peer ({0}).</value>
+ <data name="net_http_hpack_encode_failure" xml:space="preserve">
+ <value>Failed to HPACK encode the headers.</value>
+ </data>
+ <data name="net_http_hpack_huffman_decode_failed" xml:space="preserve">
+ <value>Huffman-coded literal string failed to decode.</value>
+ </data>
+ <data name="net_http_hpack_incomplete_header_block" xml:space="preserve">
+ <value>Incomplete header block received.</value>
+ </data>
+ <data name="net_http_hpack_invalid_index" xml:space="preserve">
+ <value>Invalid header index: {0} is outside of static table and no dynamic table entry found.</value>
+ </data>
+ <data name="net_http_hpack_large_table_size_update" xml:space="preserve">
+ <value>A dynamic table size update of {0} octets is greater than the configured maximum size of {1} octets.</value>
+ </data>
+ <data name="net_http_hpack_late_dynamic_table_size_update" xml:space="preserve">
+ <value>Dynamic table size update received after beginning of header block.</value>
+ </data>
+ <data name="net_http_hpack_unexpected_end" xml:space="preserve">
+ <value>End of headers reached with incomplete token.</value>
+ </data>
+ <data name="net_http_invalid_header_name" xml:space="preserve">
+ <value>Received an invalid header name: '{0}'.</value>
+ </data>
+ <data name="net_http_qpack_no_dynamic_table" xml:space="preserve">
+ <value>No dynamic table support</value>
+ </data>
+ <data name="net_http_request_invalid_char_encoding" xml:space="preserve">
+ <value>Request headers must contain only ASCII characters.</value>
</data>
</root> \ No newline at end of file
diff --git a/src/libraries/System.Net.Http/src/Resources/Strings.resx b/src/libraries/System.Net.Http/src/Resources/Strings.resx
index 456e14ce31d..00a33806032 100644
--- a/src/libraries/System.Net.Http/src/Resources/Strings.resx
+++ b/src/libraries/System.Net.Http/src/Resources/Strings.resx
@@ -540,4 +540,16 @@
<data name="net_http_request_timedout" xml:space="preserve">
<value>The request was canceled due to the configured HttpClient.Timeout of {0} seconds elapsing.</value>
</data>
+ <data name="net_quic_connectionaborted" xml:space="preserve">
+ <value>Connection aborted by peer ({0}).</value>
+ </data>
+ <data name="net_quic_notsupported" xml:space="preserve">
+ <value>QUIC is not supported on this platform. See http://aka.ms/dotnetquic</value>
+ </data>
+ <data name="net_quic_operationaborted" xml:space="preserve">
+ <value>Operation aborted.</value>
+ </data>
+ <data name="net_quic_streamaborted" xml:space="preserve">
+ <value>Stream aborted by peer ({0}).</value>
+ </data>
</root> \ No newline at end of file
diff --git a/src/libraries/System.Net.Http/src/System.Net.Http.csproj b/src/libraries/System.Net.Http/src/System.Net.Http.csproj
index cbcd8ca7577..3cd8695e9a5 100644
--- a/src/libraries/System.Net.Http/src/System.Net.Http.csproj
+++ b/src/libraries/System.Net.Http/src/System.Net.Http.csproj
@@ -1,4 +1,4 @@
-<Project Sdk="Microsoft.NET.Sdk">
+<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Library</OutputType>
<AssemblyName>System.Net.Http</AssemblyName>
@@ -7,7 +7,7 @@
<NoWarn>$(NoWarn);0436;CS1573</NoWarn>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<DefineConstants>$(DefineConstants);HTTP_DLL</DefineConstants>
- <TargetFrameworks>$(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-OSX</TargetFrameworks>
+ <TargetFrameworks>$(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Linux;$(NetCoreAppCurrent)-OSX</TargetFrameworks>
</PropertyGroup>
<PropertyGroup Condition=" '$(TargetsOSX)' == 'true' ">
<DefineConstants>$(DefineConstants);SYSNETHTTP_NO_OPENSSL</DefineConstants>
@@ -249,6 +249,108 @@
<Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Http3\QPack\H3StaticTable.cs">
<Link>Common\System\Net\Http\aspnetcore\Http3\QPack\H3StaticTable.cs</Link>
</Compile>
+ <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\Internal\MsQuicAddressHelpers.cs">
+ <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\Internal\MsQuicAddressHelpers.cs</Link>
+ </Compile>
+ <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\Internal\MsQuicApi.cs">
+ <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\Internal\MsQuicApi.cs</Link>
+ </Compile>
+ <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\Internal\MsQuicParameterHelpers.cs">
+ <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\Internal\MsQuicParameterHelpers.cs</Link>
+ </Compile>
+ <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\Internal\MsQuicSecurityConfig.cs">
+ <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\Internal\MsQuicSecurityConfig.cs</Link>
+ </Compile>
+ <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\Internal\MsQuicSession.cs">
+ <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\Internal\MsQuicSession.cs</Link>
+ </Compile>
+ <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\Internal\QuicExceptionHelpers.cs">
+ <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\Internal\QuicExceptionHelpers.cs</Link>
+ </Compile>
+ <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\Internal\ResettableCompletionSource.cs">
+ <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\Internal\ResettableCompletionSource.cs</Link>
+ </Compile>
+ <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\MsQuicConnection.cs">
+ <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\MsQuicConnection.cs</Link>
+ </Compile>
+ <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\MsQuicImplementationProvider.cs">
+ <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\MsQuicImplementationProvider.cs</Link>
+ </Compile>
+ <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\MsQuicListener.cs">
+ <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\MsQuicListener.cs</Link>
+ </Compile>
+ <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\MsQuicStream.cs">
+ <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\MsQuicStream.cs</Link>
+ </Compile>
+ <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\QuicImplementationProvider.cs">
+ <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\QuicImplementationProvider.cs</Link>
+ </Compile>
+ <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\QuicListenerProvider.cs">
+ <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\QuicListenerProvider.cs</Link>
+ </Compile>
+ <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\QuicConnectionProvider.cs">
+ <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\QuicConnectionProvider.cs</Link>
+ </Compile>
+ <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\QuicStreamProvider.cs">
+ <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\QuicStreamProvider.cs</Link>
+ </Compile>
+ <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\Mock\MockImplementationProvider.cs">
+ <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\Mock\MockImplementationProvider.cs</Link>
+ </Compile>
+ <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\Mock\MockListener.cs">
+ <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\Mock\MockListener.cs</Link>
+ </Compile>
+ <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\Mock\MockConnection.cs">
+ <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\Mock\MockConnection.cs</Link>
+ </Compile>
+ <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\Mock\MockStream.cs">
+ <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\Mock\MockStream.cs</Link>
+ </Compile>
+ <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Interop\MsQuicStatusCodes.cs" >
+ <Link>Common\System\Net\Http\aspnetcore\Quic\Interop\MsQuicStatusCodes.cs</Link>
+ </Compile>
+ <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Interop\MsQuicStatusHelper.cs">
+ <Link>Common\System\Net\Http\aspnetcore\Quic\Interop\MsQuicStatusHelper.cs</Link>
+ </Compile>
+ <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\QuicClientConnectionOptions.cs">
+ <Link>Common\System\Net\Http\aspnetcore\Quic\QuicClientConnectionOptions.cs</Link>
+ </Compile>
+ <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\QuicImplementationProviders.cs">
+ <Link>Common\System\Net\Http\aspnetcore\Quic\QuicImplementationProviders.cs</Link>
+ </Compile>
+ <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\QuicConnection.cs">
+ <Link>Common\System\Net\Http\aspnetcore\Quic\QuicConnection.cs</Link>
+ </Compile>
+ <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\QuicListener.cs">
+ <Link>Common\System\Net\Http\aspnetcore\Quic\QuicListener.cs</Link>
+ </Compile>
+ <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\QuicListenerOptions.cs">
+ <Link>Common\System\Net\Http\aspnetcore\Quic\QuicListenerOptions.cs</Link>
+ </Compile>
+ <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\QuicOperationAbortedException.cs">
+ <Link>Common\System\Net\Http\aspnetcore\Quic\QuicOperationAbortedException.cs</Link>
+ </Compile>
+ <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\QuicStream.cs">
+ <Link>Common\System\Net\Http\aspnetcore\Quic\QuicStream.cs</Link>
+ </Compile>
+ <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\QuicException.cs">
+ <Link>Common\System\Net\Http\aspnetcore\Quic\QuicException.cs</Link>
+ </Compile>
+ <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\QuicConnectionAbortedException.cs">
+ <Link>Common\System\Net\Http\aspnetcore\Quic\QuicConnectionAbortedException.cs</Link>
+ </Compile>
+ <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\QuicStreamAbortedException.cs">
+ <Link>Common\System\Net\Http\aspnetcore\Quic\QuicStreamAbortedException.cs</Link>
+ </Compile>
+ <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Interop\Interop.MsQuic.cs">
+ <Link>Common\System\Net\Http\aspnetcore\Quic\Interop\Interop.MsQuic.cs</Link>
+ </Compile>
+ <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Interop\MsQuicEnums.cs">
+ <Link>Common\System\Net\Http\aspnetcore\Quic\Interop\MsQuicEnums.cs</Link>
+ </Compile>
+ <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Interop\MsQuicNativeMethods.cs">
+ <Link>Common\System\Net\Http\aspnetcore\Quic\Interop\MsQuicNativeMethods.cs</Link>
+ </Compile>
<Compile Include="$(CommonPath)System\Net\SecurityStatusPal.cs">
<Link>Common\System\Net\SecurityStatusPal.cs</Link>
</Compile>
@@ -289,6 +391,12 @@
<Link>Common\System\Text\ValueStringBuilder.cs</Link>
</Compile>
</ItemGroup>
+ <!-- Linux specific files -->
+ <ItemGroup Condition="'$(TargetsLinux)' == 'true' ">
+ <Compile Include="$(CommonPath)Interop\Linux\Interop.Libraries.cs">
+ <Link>Common\Interop\Linux\Interop.Libraries.cs</Link>
+ </Compile>
+ </ItemGroup>
<!-- SocketsHttpHandler platform parts -->
<ItemGroup Condition=" '$(TargetsUnix)' == 'true'">
<Compile Include="System\Net\Http\SocketsHttpHandler\HttpEnvironmentProxy.cs" />
@@ -730,10 +838,10 @@
<Reference Include="System.Net.Primitives" />
<Reference Include="System.Net.Security" />
<Reference Include="System.Net.Sockets" />
- <Reference Include="System.Net.Quic" />
<Reference Include="System.Runtime" />
<Reference Include="System.Runtime.Extensions" />
<Reference Include="System.Runtime.InteropServices" />
+ <Reference Include="System.Runtime.InteropServices.RuntimeInformation" />
<Reference Include="System.Security.Claims" Condition="'$(TargetsWindows)' == 'true'" />
<Reference Include="System.Security.Cryptography.Algorithms" />
<Reference Include="System.Security.Cryptography.Csp" />
@@ -743,6 +851,7 @@
<Reference Include="System.Security.Principal" Condition="'$(TargetsWindows)' == 'true'" />
<Reference Include="System.Security.Principal.Windows" />
<Reference Include="System.Threading" />
+ <Reference Include="System.Threading.Channels" />
<Reference Include="System.IO.Compression.Brotli" />
</ItemGroup>
<ItemGroup Condition="'$(TargetsUnix)' == 'true'">
@@ -754,4 +863,21 @@
<Reference Include="System.Security.Cryptography.OpenSsl" />
<Reference Include="System.Security.Cryptography.Primitives" />
</ItemGroup>
+ <ItemGroup>
+ <Content Include="msquic.dll" Condition="Exists('msquic.dll')">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ <CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
+ </Content>
+ <Content Include="libmsquic.so" Condition="Exists('libmsquic.so')">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ <CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
+ </Content>
+ <Content Include="msquic.pdb" Condition="Exists('msquic.pdb')">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ <CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
+ </Content>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="Resources\SR.resx" />
+ </ItemGroup>
</Project>
diff --git a/src/libraries/System.Net.Quic/tests/FunctionalTests/MsQuicTestBase.cs b/src/libraries/System.Net.Http/tests/FunctionalTests/MsQuicTestBase.cs
index f2f6bf16cb0..373db5c727f 100644
--- a/src/libraries/System.Net.Quic/tests/FunctionalTests/MsQuicTestBase.cs
+++ b/src/libraries/System.Net.Http/tests/FunctionalTests/MsQuicTestBase.cs
@@ -22,24 +22,24 @@ namespace System.Net.Quic.Tests
};
}
- public QuicConnection CreateQuicConnection(IPEndPoint endpoint)
+ internal QuicConnection CreateQuicConnection(IPEndPoint endpoint)
{
return new QuicConnection(QuicImplementationProviders.MsQuic, endpoint, GetSslClientAuthenticationOptions());
}
- public QuicListener CreateQuicListener()
+ internal QuicListener CreateQuicListener()
{
return CreateQuicListener(new IPEndPoint(IPAddress.Loopback, 0));
}
- public QuicListener CreateQuicListener(IPEndPoint endpoint)
+ internal QuicListener CreateQuicListener(IPEndPoint endpoint)
{
QuicListener listener = new QuicListener(QuicImplementationProviders.MsQuic, endpoint, GetSslServerAuthenticationOptions());
listener.Start();
return listener;
}
- public async Task RunClientServer(Func<QuicConnection, Task> clientFunction, Func<QuicConnection, Task> serverFunction, int millisecondsTimeout = 10_000)
+ internal async Task RunClientServer(Func<QuicConnection, Task> clientFunction, Func<QuicConnection, Task> serverFunction, int millisecondsTimeout = 10_000)
{
using QuicListener listener = CreateQuicListener();
diff --git a/src/libraries/System.Net.Quic/tests/FunctionalTests/MsQuicTests.cs b/src/libraries/System.Net.Http/tests/FunctionalTests/MsQuicTests.cs
index 8a46f42c0cd..8a46f42c0cd 100644
--- a/src/libraries/System.Net.Quic/tests/FunctionalTests/MsQuicTests.cs
+++ b/src/libraries/System.Net.Http/tests/FunctionalTests/MsQuicTests.cs
diff --git a/src/libraries/System.Net.Quic/tests/FunctionalTests/QuicConnectionTests.cs b/src/libraries/System.Net.Http/tests/FunctionalTests/QuicConnectionTests.cs
index f403e90b190..f403e90b190 100644
--- a/src/libraries/System.Net.Quic/tests/FunctionalTests/QuicConnectionTests.cs
+++ b/src/libraries/System.Net.Http/tests/FunctionalTests/QuicConnectionTests.cs
diff --git a/src/libraries/System.Net.Quic/tests/FunctionalTests/QuicListenerTests.cs b/src/libraries/System.Net.Http/tests/FunctionalTests/QuicListenerTests.cs
index 2c729c260e5..2c729c260e5 100644
--- a/src/libraries/System.Net.Quic/tests/FunctionalTests/QuicListenerTests.cs
+++ b/src/libraries/System.Net.Http/tests/FunctionalTests/QuicListenerTests.cs
diff --git a/src/libraries/System.Net.Quic/tests/FunctionalTests/QuicStreamTests.cs b/src/libraries/System.Net.Http/tests/FunctionalTests/QuicStreamTests.cs
index 1a653137119..1a653137119 100644
--- a/src/libraries/System.Net.Quic/tests/FunctionalTests/QuicStreamTests.cs
+++ b/src/libraries/System.Net.Http/tests/FunctionalTests/QuicStreamTests.cs
diff --git a/src/libraries/System.Net.Http/tests/FunctionalTests/System.Net.Http.Functional.Tests.csproj b/src/libraries/System.Net.Http/tests/FunctionalTests/System.Net.Http.Functional.Tests.csproj
index 8cb7a61d24c..6aa7ae56441 100644
--- a/src/libraries/System.Net.Http/tests/FunctionalTests/System.Net.Http.Functional.Tests.csproj
+++ b/src/libraries/System.Net.Http/tests/FunctionalTests/System.Net.Http.Functional.Tests.csproj
@@ -1,15 +1,127 @@
-<Project Sdk="Microsoft.NET.Sdk">
+<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
+ <StringResourcesPath>../../src/Resources/Strings.resx</StringResourcesPath>
<DefineConstants Condition="'$(TargetsWindows)'=='true'">$(DefineConstants);TargetsWindows</DefineConstants>
- <DefineConstants>$(DefineConstants);SYSNETHTTP_NO_OPENSSL</DefineConstants>
+ <DefineConstants>$(DefineConstants);SYSNETHTTP_NO_OPENSSL;HTTP3</DefineConstants>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<IncludeRemoteExecutor>true</IncludeRemoteExecutor>
- <TargetFrameworks>$(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Unix</TargetFrameworks>
+ <TargetFrameworks>$(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Linux;$(NetCoreAppCurrent)-OSX</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<Compile Include="$(CommonPath)Interop\Unix\Interop.Libraries.cs" Condition="'$(TargetsUnix)' == 'true'">
<Link>Common\Interop\Unix\Interop.Libraries.cs</Link>
</Compile>
+ <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\NetEventSource.Common.cs">
+ <Link>Common\System\Net\Http\aspnetcore\NetEventSource.Common.cs</Link>
+ </Compile>
+ <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\Internal\MsQuicAddressHelpers.cs" >
+ <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\Internal\MsQuicAddressHelpers.cs</Link>
+ </Compile>
+ <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\Internal\MsQuicApi.cs" >
+ <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\Internal\MsQuicApi.cs</Link>
+ </Compile>
+ <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\Internal\MsQuicParameterHelpers.cs" >
+ <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\Internal\MsQuicParameterHelpers.cs</Link>
+ </Compile>
+ <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\Internal\MsQuicSecurityConfig.cs" >
+ <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\Internal\MsQuicSecurityConfig.cs</Link>
+ </Compile>
+ <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\Internal\MsQuicSession.cs" >
+ <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\Internal\MsQuicSession.cs</Link>
+ </Compile>
+ <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\Internal\QuicExceptionHelpers.cs" >
+ <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\Internal\QuicExceptionHelpers.cs</Link>
+ </Compile>
+ <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\Internal\ResettableCompletionSource.cs" >
+ <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\Internal\ResettableCompletionSource.cs</Link>
+ </Compile>
+ <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\MsQuicConnection.cs" >
+ <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\MsQuicConnection.cs</Link>
+ </Compile>
+ <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\MsQuicImplementationProvider.cs" >
+ <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\MsQuicImplementationProvider.cs</Link>
+ </Compile>
+ <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\MsQuicListener.cs" >
+ <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\MsQuicListener.cs</Link>
+ </Compile>
+ <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\MsQuicStream.cs" >
+ <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\MsQuicStream.cs</Link>
+ </Compile>
+ <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\QuicImplementationProvider.cs" >
+ <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\QuicImplementationProvider.cs</Link>
+ </Compile>
+ <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\QuicListenerProvider.cs" >
+ <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\QuicListenerProvider.cs</Link>
+ </Compile>
+ <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\QuicConnectionProvider.cs" >
+ <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\QuicConnectionProvider.cs</Link>
+ </Compile>
+ <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\QuicStreamProvider.cs" >
+ <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\QuicStreamProvider.cs</Link>
+ </Compile>
+ <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\Mock\MockImplementationProvider.cs" >
+ <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\Mock\MockImplementationProvider.cs</Link>
+ </Compile>
+ <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\Mock\MockListener.cs" >
+ <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\Mock\MockListener.cs</Link>
+ </Compile>
+ <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\Mock\MockConnection.cs" >
+ <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\Mock\MockConnection.cs</Link>
+ </Compile>
+ <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\Mock\MockStream.cs" >
+ <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\Mock\MockStream.cs</Link>
+ </Compile>
+ <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Interop\MsQuicStatusCodes.cs" >
+ <Link>Common\System\Net\Http\aspnetcore\Quic\Interop\MsQuicStatusCodes.cs</Link>
+ </Compile>
+ <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Interop\MsQuicStatusHelper.cs" >
+ <Link>Common\System\Net\Http\aspnetcore\Quic\Interop\MsQuicStatusHelper.cs</Link>
+ </Compile>
+ <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\NetEventSource.Quic.cs" >
+ <Link>Common\System\Net\Http\aspnetcore\Quic\NetEventSource.Quic.cs</Link>
+ </Compile>
+ <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\QuicClientConnectionOptions.cs" >
+ <Link>Common\System\Net\Http\aspnetcore\Quic\QuicClientConnectionOptions.cs</Link>
+ </Compile>
+ <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\QuicImplementationProviders.cs" >
+ <Link>Common\System\Net\Http\aspnetcore\Quic\QuicImplementationProviders.cs</Link>
+ </Compile>
+ <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\QuicConnection.cs" >
+ <Link>Common\System\Net\Http\aspnetcore\Quic\QuicConnection.cs</Link>
+ </Compile>
+ <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\QuicListener.cs" >
+ <Link>Common\System\Net\Http\aspnetcore\Quic\QuicListener.cs</Link>
+ </Compile>
+ <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\QuicListenerOptions.cs" >
+ <Link>Common\System\Net\Http\aspnetcore\Quic\QuicListenerOptions.cs</Link>
+ </Compile>
+ <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\QuicOperationAbortedException.cs" >
+ <Link>Common\System\Net\Http\aspnetcore\Quic\QuicOperationAbortedException.cs</Link>
+ </Compile>
+ <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\QuicStream.cs" >
+ <Link>Common\System\Net\Http\aspnetcore\Quic\QuicStream.cs</Link>
+ </Compile>
+ <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\QuicException.cs" >
+ <Link>Common\System\Net\Http\aspnetcore\Quic\QuicException.cs</Link>
+ </Compile>
+ <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\QuicConnectionAbortedException.cs" >
+ <Link>Common\System\Net\Http\aspnetcore\Quic\QuicConnectionAbortedException.cs</Link>
+ </Compile>
+ <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\QuicStreamAbortedException.cs" >
+ <Link>Common\System\Net\Http\aspnetcore\Quic\QuicStreamAbortedException.cs</Link>
+ </Compile>
+ <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Interop\Interop.MsQuic.cs" >
+ <Link>Common\System\Net\Http\aspnetcore\Quic\Interop\Interop.MsQuic.cs</Link>
+ </Compile>
+ <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Interop\MsQuicEnums.cs" >
+ <Link>Common\System\Net\Http\aspnetcore\Quic\Interop\MsQuicEnums.cs</Link>
+ </Compile>
+ <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Interop\MsQuicNativeMethods.cs" >
+ <Link>Common\System\Net\Http\aspnetcore\Quic\Interop\MsQuicNativeMethods.cs</Link>
+ </Compile>
+ <Compile Include="$(CommonPath)System\Threading\Tasks\TaskToApm.cs">
+ <Link>System\System\Threading\Tasks\TaskToApm.cs</Link>
+ </Compile>
<Compile Include="$(CommonPath)Interop\Unix\System.Net.Security.Native\Interop.NetSecurityNative.IsNtlmInstalled.cs" Condition="'$(TargetsUnix)' == 'true'">
<Link>Common\Interop\Unix\System.Net.Security.Native\Interop.NetSecurityNative.IsNtlmInstalled.cs</Link>
</Compile>
@@ -177,12 +289,17 @@
</Compile>
<Compile Include="HttpRequestMessageTest.cs" />
<Compile Include="HttpResponseMessageTest.cs" />
+ <Compile Include="MsQuicTestBase.cs" />
+ <Compile Include="MsQuicTests.cs" />
<Compile Include="MessageProcessingHandlerTest.cs" />
<Compile Include="MultipartContentTest.cs" />
<Compile Include="MultipartFormDataContentTest.cs" />
<Compile Include="$(CommonTestPath)System\Net\Http\PostScenarioTest.cs">
<Link>Common\System\Net\Http\PostScenarioTest.cs</Link>
</Compile>
+ <Compile Include="QuicConnectionTests.cs" />
+ <Compile Include="QuicListenerTests.cs" />
+ <Compile Include="QuicStreamTests.cs" />
<Compile Include="$(CommonTestPath)System\Net\Http\RepeatedFlushContent.cs">
<Link>Common\System\Net\Http\RepeatedFlushContent.cs</Link>
</Compile>
@@ -203,6 +320,24 @@
<Compile Include="ThrowingContent.cs" />
<Compile Include="Watchdog.cs" />
</ItemGroup>
+ <!-- Windows specific files -->
+ <ItemGroup Condition=" '$(TargetsWindows)' == 'true'">
+ <Compile Include="$(CommonPath)Interop\Windows\Interop.Libraries.cs">
+ <Link>Common\Interop\Windows\Interop.Libraries.cs</Link>
+ </Compile>
+ </ItemGroup>
+ <!-- Linux specific files -->
+ <ItemGroup Condition="'$(TargetsLinux)' == 'true' ">
+ <Compile Include="$(CommonPath)Interop\Linux\Interop.Libraries.cs">
+ <Link>Common\Interop\Linux\Interop.Libraries.cs</Link>
+ </Compile>
+ </ItemGroup>
+ <!-- OSX specific files -->
+ <ItemGroup Condition=" '$(TargetsOSX)' == 'true' ">
+ <Compile Include="$(CommonPath)Interop\OSX\Interop.Libraries.cs">
+ <Link>Common\Interop\OSX\Interop.Libraries.cs</Link>
+ </Compile>
+ </ItemGroup>
<ItemGroup>
<Compile Include="CustomContent.netcore.cs" />
<Compile Include="HPackTest.cs" />
diff --git a/src/libraries/System.Net.Quic/Directory.Build.props b/src/libraries/System.Net.Quic/Directory.Build.props
deleted file mode 100644
index 23ff074b015..00000000000
--- a/src/libraries/System.Net.Quic/Directory.Build.props
+++ /dev/null
@@ -1,11 +0,0 @@
-<Project>
- <Import Project="..\Directory.Build.props" />
- <PropertyGroup>
- <AssemblyVersion>4.2.1.0</AssemblyVersion>
- <StrongNameKeyId>Microsoft</StrongNameKeyId>
- <IsNETCoreApp>true</IsNETCoreApp>
- <!-- This is a preview package. Do not mark as stable. -->
- <SuppressFinalPackageVersion>true</SuppressFinalPackageVersion>
- <IsShippingAssembly>false</IsShippingAssembly>
- </PropertyGroup>
-</Project>
diff --git a/src/libraries/System.Net.Quic/System.Net.Quic.sln b/src/libraries/System.Net.Quic/System.Net.Quic.sln
deleted file mode 100644
index 7b503d9f5f5..00000000000
--- a/src/libraries/System.Net.Quic/System.Net.Quic.sln
+++ /dev/null
@@ -1,53 +0,0 @@
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 15
-VisualStudioVersion = 15.0.27213.1
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Net.Quic.Tests", "tests\FunctionalTests\System.Net.Quic.Tests.csproj", "{8CBA022C-635F-4C8D-9D29-CD8AAC68C8E6}"
- ProjectSection(ProjectDependencies) = postProject
- {43311AFB-D7C4-4E5A-B1DE-855407F90D1B} = {43311AFB-D7C4-4E5A-B1DE-855407F90D1B}
- EndProjectSection
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Net.Quic", "src\System.Net.Quic.csproj", "{43311AFB-D7C4-4E5A-B1DE-855407F90D1B}"
- ProjectSection(ProjectDependencies) = postProject
- {834E3534-6A11-4A8D-923F-35C1E71CCEC3} = {834E3534-6A11-4A8D-923F-35C1E71CCEC3}
- EndProjectSection
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Net.Quic", "ref\System.Net.Quic.csproj", "{834E3534-6A11-4A8D-923F-35C1E71CCEC3}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{1A2F9F4A-A032-433E-B914-ADD5992BB178}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{E107E9C1-E893-4E87-987E-04EF0DCEAEFD}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ref", "ref", "{2E666815-2EDB-464B-9DF6-380BF4789AD4}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- Release|Any CPU = Release|Any CPU
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {8CBA022C-635F-4C8D-9D29-CD8AAC68C8E6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {8CBA022C-635F-4C8D-9D29-CD8AAC68C8E6}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {8CBA022C-635F-4C8D-9D29-CD8AAC68C8E6}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {8CBA022C-635F-4C8D-9D29-CD8AAC68C8E6}.Release|Any CPU.Build.0 = Release|Any CPU
- {43311AFB-D7C4-4E5A-B1DE-855407F90D1B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {43311AFB-D7C4-4E5A-B1DE-855407F90D1B}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {43311AFB-D7C4-4E5A-B1DE-855407F90D1B}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {43311AFB-D7C4-4E5A-B1DE-855407F90D1B}.Release|Any CPU.Build.0 = Release|Any CPU
- {834E3534-6A11-4A8D-923F-35C1E71CCEC3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {834E3534-6A11-4A8D-923F-35C1E71CCEC3}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {834E3534-6A11-4A8D-923F-35C1E71CCEC3}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {834E3534-6A11-4A8D-923F-35C1E71CCEC3}.Release|Any CPU.Build.0 = Release|Any CPU
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
- GlobalSection(NestedProjects) = preSolution
- {8CBA022C-635F-4C8D-9D29-CD8AAC68C8E6} = {1A2F9F4A-A032-433E-B914-ADD5992BB178}
- {43311AFB-D7C4-4E5A-B1DE-855407F90D1B} = {E107E9C1-E893-4E87-987E-04EF0DCEAEFD}
- {834E3534-6A11-4A8D-923F-35C1E71CCEC3} = {2E666815-2EDB-464B-9DF6-380BF4789AD4}
- EndGlobalSection
- GlobalSection(ExtensibilityGlobals) = postSolution
- SolutionGuid = {6E33D5E2-B9BF-49D1-99FA-3C9AC3412636}
- EndGlobalSection
-EndGlobal
diff --git a/src/libraries/System.Net.Quic/ref/System.Net.Quic.Temporary.cs b/src/libraries/System.Net.Quic/ref/System.Net.Quic.Temporary.cs
deleted file mode 100644
index 3080f84c38f..00000000000
--- a/src/libraries/System.Net.Quic/ref/System.Net.Quic.Temporary.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-// ------------------------------------------------------------------------------
-// Changes to this file must follow the https://aka.ms/api-review process.
-// ------------------------------------------------------------------------------
-
-using System.Threading;
-
-namespace System.Net.Quic
-{
- public sealed partial class QuicConnection : System.IDisposable
- {
- public QuicConnection(System.Net.Quic.Implementations.QuicImplementationProvider implementationProvider, IPEndPoint remoteEndPoint, System.Net.Security.SslClientAuthenticationOptions sslClientAuthenticationOptions, IPEndPoint localEndPoint = null) { }
- public QuicConnection(System.Net.Quic.Implementations.QuicImplementationProvider implementationProvider, QuicClientConnectionOptions options) { }
- }
- public sealed partial class QuicListener : IDisposable
- {
- public QuicListener(System.Net.Quic.Implementations.QuicImplementationProvider implementationProvider, IPEndPoint listenEndPoint, System.Net.Security.SslServerAuthenticationOptions sslServerAuthenticationOptions) { }
- public QuicListener(System.Net.Quic.Implementations.QuicImplementationProvider implementationProvider, QuicListenerOptions option) { }
- }
- public static class QuicImplementationProviders
- {
- public static System.Net.Quic.Implementations.QuicImplementationProvider Mock { get { throw null; } }
- public static System.Net.Quic.Implementations.QuicImplementationProvider MsQuic { get { throw null; } }
- public static System.Net.Quic.Implementations.QuicImplementationProvider Default { get { throw null; } }
- }
-}
-namespace System.Net.Quic.Implementations
-{
- public abstract class QuicImplementationProvider
- {
- internal QuicImplementationProvider() { }
- }
-}
diff --git a/src/libraries/System.Net.Quic/ref/System.Net.Quic.cs b/src/libraries/System.Net.Quic/ref/System.Net.Quic.cs
deleted file mode 100644
index 80fbd285e5f..00000000000
--- a/src/libraries/System.Net.Quic/ref/System.Net.Quic.cs
+++ /dev/null
@@ -1,104 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-// ------------------------------------------------------------------------------
-// Changes to this file must follow the https://aka.ms/api-review process.
-// ------------------------------------------------------------------------------
-
-using System.Buffers;
-using System.Net.Security;
-using System.Threading;
-using System.Threading.Tasks;
-
-namespace System.Net.Quic
-{
- public sealed partial class QuicConnection : System.IDisposable
- {
- public QuicConnection(IPEndPoint remoteEndPoint, System.Net.Security.SslClientAuthenticationOptions sslClientAuthenticationOptions, IPEndPoint localEndPoint = null) { }
- public System.Threading.Tasks.ValueTask ConnectAsync(System.Threading.CancellationToken cancellationToken = default) { throw null; }
- public bool Connected => throw null;
- public IPEndPoint LocalEndPoint => throw null;
- public IPEndPoint RemoteEndPoint => throw null;
- public QuicStream OpenUnidirectionalStream() => throw null;
- public QuicStream OpenBidirectionalStream() => throw null;
- public long GetRemoteAvailableUnidirectionalStreamCount() => throw null;
- public long GetRemoteAvailableBidirectionalStreamCount() => throw null;
- public System.Threading.Tasks.ValueTask<QuicStream> AcceptStreamAsync(System.Threading.CancellationToken cancellationToken = default) => throw null;
- public System.Net.Security.SslApplicationProtocol NegotiatedApplicationProtocol => throw null;
- public ValueTask CloseAsync(long errorCode, System.Threading.CancellationToken cancellationToken = default) => throw null;
- public void Dispose() => throw null;
- public static bool IsQuicSupported => throw null;
- }
- public sealed partial class QuicListener : IDisposable
- {
- public QuicListener(IPEndPoint listenEndPoint, System.Net.Security.SslServerAuthenticationOptions sslServerAuthenticationOptions) { }
- public IPEndPoint ListenEndPoint => throw null;
- public System.Threading.Tasks.ValueTask<QuicConnection> AcceptConnectionAsync(System.Threading.CancellationToken cancellationToken = default) => throw null;
- public void Start() => throw null;
- public void Close() => throw null;
- public void Dispose() => throw null;
- }
- public sealed class QuicStream : System.IO.Stream
- {
- internal QuicStream() { }
- public override bool CanSeek => throw null;
- public override long Length => throw null;
- public override long Seek(long offset, System.IO.SeekOrigin origin) => throw null;
- public override void SetLength(long value) => throw null;
- public override long Position { get => throw null; set => throw null; }
- public override bool CanRead => throw null;
- public override bool CanWrite => throw null;
- public override void Flush() => throw null;
- public override int Read(byte[] buffer, int offset, int count) => throw null;
- public override void Write(byte[] buffer, int offset, int count) => throw null;
- public long StreamId => throw null;
- public void AbortRead(long errorCode) => throw null;
- public void AbortWrite(long errorCode) => throw null;
- public ValueTask WriteAsync(ReadOnlyMemory<byte> data, bool endStream, System.Threading.CancellationToken cancellationToken = default) => throw null;
- public ValueTask WriteAsync(ReadOnlySequence<byte> data, System.Threading.CancellationToken cancellationToken = default) => throw null;
- public ValueTask WriteAsync(ReadOnlySequence<byte> data, bool endStream, System.Threading.CancellationToken cancellationToken = default) => throw null;
- public ValueTask WriteAsync(ReadOnlyMemory<ReadOnlyMemory<byte>> data, System.Threading.CancellationToken cancellationToken = default) => throw null;
- public ValueTask WriteAsync(ReadOnlyMemory<ReadOnlyMemory<byte>> data, bool endStream, System.Threading.CancellationToken cancellationToken = default) => throw null;
- public ValueTask ShutdownWriteCompleted(System.Threading.CancellationToken cancellationToken = default) => throw null;
- public void Shutdown() => throw null;
- }
- public class QuicClientConnectionOptions
- {
- public SslClientAuthenticationOptions ClientAuthenticationOptions { get => throw null; set => throw null; }
- public IPEndPoint LocalEndPoint { get => throw null; set => throw null; }
- public IPEndPoint RemoteEndPoint { get => throw null; set => throw null; }
- public long MaxBidirectionalStreams { get => throw null; set => throw null; }
- public long MaxUnidirectionalStreams { get => throw null; set => throw null; }
- public TimeSpan IdleTimeout { get => throw null; set => throw null; }
- }
- public class QuicListenerOptions
- {
- public SslServerAuthenticationOptions ServerAuthenticationOptions { get => throw null; set => throw null; }
- public string CertificateFilePath { get => throw null; set => throw null; }
- public string PrivateKeyFilePath { get => throw null; set => throw null; }
- public IPEndPoint ListenEndPoint { get => throw null; set => throw null; }
- public int ListenBacklog { get => throw null; set => throw null; }
- public long MaxBidirectionalStreams { get => throw null; set => throw null; }
- public long MaxUnidirectionalStreams { get => throw null; set => throw null; }
- public TimeSpan IdleTimeout { get => throw null; set => throw null; }
- }
- public class QuicException : Exception
- {
- public QuicException(string message) : base(message) { }
- }
- public class QuicConnectionAbortedException : QuicException
- {
- public QuicConnectionAbortedException(string message, long errorCode) : base(message) { }
- public long ErrorCode { get; }
-
- }
- public class QuicStreamAbortedException : QuicException
- {
- public QuicStreamAbortedException(string message, long errorCode) : base(message) { }
- public long ErrorCode { get; }
- }
- public class QuicOperationAbortedException : QuicException
- {
- public QuicOperationAbortedException(string message) : base(message) { }
- }
-}
diff --git a/src/libraries/System.Net.Quic/ref/System.Net.Quic.csproj b/src/libraries/System.Net.Quic/ref/System.Net.Quic.csproj
deleted file mode 100644
index ae388ea1bad..00000000000
--- a/src/libraries/System.Net.Quic/ref/System.Net.Quic.csproj
+++ /dev/null
@@ -1,16 +0,0 @@
-<Project Sdk="Microsoft.NET.Sdk">
- <PropertyGroup>
- <TargetFrameworks>$(NetCoreAppCurrent)</TargetFrameworks>
- </PropertyGroup>
- <ItemGroup>
- <Compile Include="System.Net.Quic.Temporary.cs" />
- <Compile Include="System.Net.Quic.cs" />
- </ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\..\System.Memory\ref\System.Memory.csproj" />
- <ProjectReference Include="..\..\System.IO.FileSystem.Primitives\ref\System.IO.FileSystem.Primitives.csproj" />
- <ProjectReference Include="..\..\System.Net.Primitives\ref\System.Net.Primitives.csproj" />
- <ProjectReference Include="..\..\System.Net.Security\ref\System.Net.Security.csproj" />
- <ProjectReference Include="..\..\System.Runtime\ref\System.Runtime.csproj" />
- </ItemGroup>
-</Project>
diff --git a/src/libraries/System.Net.Quic/src/Interop/Linux/MsQuicStatusCodes.cs b/src/libraries/System.Net.Quic/src/Interop/Linux/MsQuicStatusCodes.cs
deleted file mode 100644
index 4152fde6b66..00000000000
--- a/src/libraries/System.Net.Quic/src/Interop/Linux/MsQuicStatusCodes.cs
+++ /dev/null
@@ -1,56 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-using System.Runtime.InteropServices;
-
-namespace System.Net.Quic.Implementations.MsQuic.Internal
-{
- internal static class MsQuicStatusCodes
- {
- internal const uint Success = 0;
- internal const uint Pending = unchecked((uint)-2);
- internal const uint Continue = unchecked((uint)-1);
- internal const uint OutOfMemory = 12;
- internal const uint InvalidParameter = 22;
- internal const uint InvalidState = 200000002;
- internal const uint NotSupported = 95;
- internal const uint NotFound = 2;
- internal const uint BufferTooSmall = 75;
- internal const uint HandshakeFailure = 200000009;
- internal const uint Aborted = 200000008;
- internal const uint AddressInUse = 98;
- internal const uint ConnectionTimeout = 110;
- internal const uint ConnectionIdle = 200000011;
- internal const uint InternalError = 200000012;
- internal const uint ServerBusy = 200000007;
- internal const uint ProtocolError = 200000013;
- internal const uint VerNegError = 200000014;
-
- public static string GetError(uint status)
- {
- return status switch
- {
- Success => "SUCCESS",
- Pending => "PENDING",
- Continue => "CONTINUE",
- OutOfMemory => "OUT_OF_MEMORY",
- InvalidParameter => "INVALID_PARAMETER",
- InvalidState => "INVALID_STATE",
- NotSupported => "NOT_SUPPORTED",
- NotFound => "NOT_FOUND",
- BufferTooSmall => "BUFFER_TOO_SMALL",
- HandshakeFailure => "HANDSHAKE_FAILURE",
- Aborted => "ABORTED",
- AddressInUse => "ADDRESS_IN_USE",
- ConnectionTimeout => "CONNECTION_TIMEOUT",
- ConnectionIdle => "CONNECTION_IDLE",
- InternalError => "INTERNAL_ERROR",
- ServerBusy => "SERVER_BUSY",
- ProtocolError => "PROTOCOL_ERROR",
- VerNegError => "VER_NEG_ERROR",
- _ => status.ToString()
- };
- }
- }
-}
diff --git a/src/libraries/System.Net.Quic/src/Interop/OSX/MsQuicStatusCodes.cs b/src/libraries/System.Net.Quic/src/Interop/OSX/MsQuicStatusCodes.cs
deleted file mode 100644
index 60c1becafb4..00000000000
--- a/src/libraries/System.Net.Quic/src/Interop/OSX/MsQuicStatusCodes.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-using System.Runtime.InteropServices;
-
-namespace System.Net.Quic.Implementations.MsQuic.Internal
-{
- internal static class MsQuicStatusCodes
- {
- internal const uint Success = 0;
- internal const uint Pending = unchecked((uint)-2);
- internal const uint Continue = unchecked((uint)-1);
- internal const uint OutOfMemory = 12;
- internal const uint InvalidParameter = 22;
- internal const uint InvalidState = 200000002;
- internal const uint NotSupported = 95;
- internal const uint NotFound = 2;
- internal const uint BufferTooSmall = 75;
- internal const uint HandshakeFailure = 200000009;
- internal const uint Aborted = 200000008;
- internal const uint AddressInUse = 98;
- internal const uint ConnectionTimeout = 110;
- internal const uint ConnectionIdle = 200000011;
- internal const uint InternalError = 200000012;
- internal const uint ServerBusy = 200000007;
- internal const uint ProtocolError = 200000013;
- internal const uint VerNegError = 200000014;
-
- public static string GetError(uint status)
- {
- throw new NotImplementedException();
- }
- }
-}
diff --git a/src/libraries/System.Net.Quic/src/Interop/OSX/MsQuicStatusHelper.cs b/src/libraries/System.Net.Quic/src/Interop/OSX/MsQuicStatusHelper.cs
deleted file mode 100644
index cae5db4593b..00000000000
--- a/src/libraries/System.Net.Quic/src/Interop/OSX/MsQuicStatusHelper.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-using System.Runtime.InteropServices;
-
-namespace System.Net.Quic.Implementations.MsQuic.Internal
-{
- internal static class MsQuicStatusHelper
- {
- internal static bool SuccessfulStatusCode(uint status)
- {
- throw new NotImplementedException();
- }
- }
-}
diff --git a/src/libraries/System.Net.Quic/src/Interop/Windows/MsQuicStatusCodes.cs b/src/libraries/System.Net.Quic/src/Interop/Windows/MsQuicStatusCodes.cs
deleted file mode 100644
index 1d0513e6118..00000000000
--- a/src/libraries/System.Net.Quic/src/Interop/Windows/MsQuicStatusCodes.cs
+++ /dev/null
@@ -1,56 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-namespace System.Net.Quic.Implementations.MsQuic.Internal
-{
- internal static class MsQuicStatusCodes
- {
- internal const uint Success = 0;
- internal const uint Pending = 0x703E5;
- internal const uint Continue = 0x704DE;
- internal const uint OutOfMemory = 0x8007000E;
- internal const uint InvalidParameter = 0x80070057;
- internal const uint InvalidState = 0x8007139F;
- internal const uint NotSupported = 0x80004002;
- internal const uint NotFound = 0x80070490;
- internal const uint BufferTooSmall = 0x8007007A;
- internal const uint HandshakeFailure = 0x80410000;
- internal const uint Aborted = 0x80004004;
- internal const uint AddressInUse = 0x80072740;
- internal const uint ConnectionTimeout = 0x800704CF;
- internal const uint ConnectionIdle = 0x800704D4;
- internal const uint InternalError = 0x80004005;
- internal const uint ServerBusy = 0x800704C9;
- internal const uint ProtocolError = 0x800704CD;
- internal const uint HostUnreachable = 0x800704D0;
- internal const uint VerNegError = 0x80410001;
-
- // TODO return better error messages here.
- public static string GetError(uint status)
- {
- return status switch
- {
- Success => "SUCCESS",
- Pending => "PENDING",
- Continue => "CONTINUE",
- OutOfMemory => "OUT_OF_MEMORY",
- InvalidParameter => "INVALID_PARAMETER",
- InvalidState => "INVALID_STATE",
- NotSupported => "NOT_SUPPORTED",
- NotFound => "NOT_FOUND",
- BufferTooSmall => "BUFFER_TOO_SMALL",
- HandshakeFailure => "HANDSHAKE_FAILURE",
- Aborted => "ABORTED",
- AddressInUse => "ADDRESS_IN_USE",
- ConnectionTimeout => "CONNECTION_TIMEOUT",
- ConnectionIdle => "CONNECTION_IDLE",
- InternalError => "INTERNAL_ERROR",
- ServerBusy => "SERVER_BUSY",
- ProtocolError => "PROTOCOL_ERROR",
- VerNegError => "VER_NEG_ERROR",
- _ => status.ToString()
- };
- }
- }
-}
diff --git a/src/libraries/System.Net.Quic/src/Interop/Windows/MsQuicStatusHelper.cs b/src/libraries/System.Net.Quic/src/Interop/Windows/MsQuicStatusHelper.cs
deleted file mode 100644
index 84918733ae9..00000000000
--- a/src/libraries/System.Net.Quic/src/Interop/Windows/MsQuicStatusHelper.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-using System.Runtime.InteropServices;
-
-namespace System.Net.Quic.Implementations.MsQuic.Internal
-{
- internal static class MsQuicStatusHelper
- {
- internal static bool SuccessfulStatusCode(uint status)
- {
- return status < 0x80000000;
- }
- }
-}
diff --git a/src/libraries/System.Net.Quic/src/System.Net.Quic.csproj b/src/libraries/System.Net.Quic/src/System.Net.Quic.csproj
deleted file mode 100644
index 729c0194cde..00000000000
--- a/src/libraries/System.Net.Quic/src/System.Net.Quic.csproj
+++ /dev/null
@@ -1,107 +0,0 @@
-<Project Sdk="Microsoft.NET.Sdk">
- <PropertyGroup>
- <AssemblyName>System.Net.Quic</AssemblyName>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <TargetFrameworks>$(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Linux;$(NetCoreAppCurrent)-OSX</TargetFrameworks>
- <EnablePInvokeAnalyzer>false</EnablePInvokeAnalyzer>
- </PropertyGroup>
- <ItemGroup>
- <!-- All configurations -->
- <Compile Include="System\Net\Quic\Implementations\MsQuic\Internal\MsQuicAddressHelpers.cs" />
- <Compile Include="System\Net\Quic\Implementations\MsQuic\Internal\MsQuicApi.cs" />
- <Compile Include="System\Net\Quic\Implementations\MsQuic\Internal\MsQuicParameterHelpers.cs" />
- <Compile Include="System\Net\Quic\Implementations\MsQuic\Internal\MsQuicSecurityConfig.cs" />
- <Compile Include="System\Net\Quic\Implementations\MsQuic\Internal\MsQuicSession.cs" />
- <Compile Include="System\Net\Quic\Implementations\MsQuic\Internal\QuicExceptionHelpers.cs" />
- <Compile Include="System\Net\Quic\Implementations\MsQuic\Internal\ResettableCompletionSource.cs" />
- <Compile Include="System\Net\Quic\Implementations\MsQuic\MsQuicConnection.cs" />
- <Compile Include="System\Net\Quic\Implementations\MsQuic\MsQuicImplementationProvider.cs" />
- <Compile Include="System\Net\Quic\Implementations\MsQuic\MsQuicListener.cs" />
- <Compile Include="System\Net\Quic\Implementations\MsQuic\MsQuicStream.cs" />
- <Compile Include="System\Net\Quic\Implementations\QuicImplementationProvider.cs" />
- <Compile Include="System\Net\Quic\Implementations\QuicListenerProvider.cs" />
- <Compile Include="System\Net\Quic\Implementations\QuicConnectionProvider.cs" />
- <Compile Include="System\Net\Quic\Implementations\QuicStreamProvider.cs" />
- <Compile Include="System\Net\Quic\Implementations\Mock\MockImplementationProvider.cs" />
- <Compile Include="System\Net\Quic\Implementations\Mock\MockListener.cs" />
- <Compile Include="System\Net\Quic\Implementations\Mock\MockConnection.cs" />
- <Compile Include="System\Net\Quic\Implementations\Mock\MockStream.cs" />
- <Compile Include="System\Net\Quic\NetEventSource.Quic.cs" />
- <Compile Include="System\Net\Quic\QuicClientConnectionOptions.cs" />
- <Compile Include="System\Net\Quic\QuicImplementationProviders.cs" />
- <Compile Include="System\Net\Quic\QuicConnection.cs" />
- <Compile Include="System\Net\Quic\QuicListener.cs" />
- <Compile Include="System\Net\Quic\QuicListenerOptions.cs" />
- <Compile Include="System\Net\Quic\QuicOperationAbortedException.cs" />
- <Compile Include="System\Net\Quic\QuicStream.cs" />
- <Compile Include="System\Net\Quic\QuicException.cs" />
- <Compile Include="System\Net\Quic\QuicConnectionAbortedException.cs" />
- <Compile Include="System\Net\Quic\QuicStreamAbortedException.cs" />
- <Compile Include="Interop\Interop.MsQuic.cs" />
- <Compile Include="Interop\MsQuicEnums.cs" />
- <Compile Include="Interop\MsQuicNativeMethods.cs" />
- <Compile Include="$(CommonPath)System\Threading\Tasks\TaskToApm.cs">
- <Link>Common\System\Threading\Tasks\TaskToApm.cs</Link>
- </Compile>
- <Compile Include="$(CommonPath)System\Net\Logging\NetEventSource.Common.cs">
- <Link>Common\System\Net\Logging\NetEventSource.Common.cs</Link>
- </Compile>
- </ItemGroup>
- <!-- Windows specific files -->
- <ItemGroup Condition=" '$(TargetsWindows)' == 'true'">
- <Compile Include="$(CommonPath)Interop\Windows\Interop.Libraries.cs">
- <Link>Common\Interop\Windows\Interop.Libraries.cs</Link>
- </Compile>
- <Compile Include="Interop\Windows\MsQuicStatusCodes.cs" />
- <Compile Include="Interop\Windows\MsQuicStatusHelper.cs" />
- </ItemGroup>
- <!-- Linux specific files -->
- <ItemGroup Condition="'$(TargetsLinux)' == 'true' ">
- <Compile Include="$(CommonPath)Interop\Linux\Interop.Libraries.cs">
- <Link>Common\Interop\Linux\Interop.Libraries.cs</Link>
- </Compile>
- <Compile Include="Interop\Linux\MsQuicStatusCodes.cs" />
- <Compile Include="Interop\Linux\MsQuicStatusHelper.cs" />
- </ItemGroup>
- <!-- OSX specific files -->
- <ItemGroup Condition=" '$(TargetsOSX)' == 'true' ">
- <Compile Include="$(CommonPath)Interop\OSX\Interop.Libraries.cs">
- <Link>Common\Interop\OSX\Interop.Libraries.cs</Link>
- </Compile>
- <Compile Include="Interop\OSX\MsQuicStatusCodes.cs" />
- <Compile Include="Interop\Linux\MsQuicStatusHelper.cs" />
- </ItemGroup>
- <ItemGroup>
- <Reference Include="System.Console" />
- <Reference Include="System.Collections" />
- <Reference Include="System.Diagnostics.Tracing" />
- <Reference Include="System.Memory" />
- <Reference Include="System.Net.NameResolution" />
- <Reference Include="System.Net.Primitives" />
- <Reference Include="System.Net.Security" />
- <Reference Include="System.Net.Sockets" />
- <Reference Include="System.Net" />
- <Reference Include="System.Runtime" />
- <Reference Include="System.Runtime.Extensions" />
- <Reference Include="System.Runtime.InteropServices" />
- <Reference Include="System.Runtime.InteropServices.RuntimeInformation" />
- <Reference Include="System.Security.Cryptography.X509Certificates" />
- <Reference Include="System.Threading" />
- <Reference Include="System.Threading.Channels" />
- <Reference Include="System.Threading.ThreadPool" />
- </ItemGroup>
- <ItemGroup>
- <Content Include="msquic.dll" Condition="Exists('msquic.dll')">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
- </Content>
- <Content Include="libmsquic.so" Condition="Exists('libmsquic.so')">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
- </Content>
- <Content Include="msquic.pdb" Condition="Exists('msquic.pdb')">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
- </Content>
- </ItemGroup>
-</Project>
diff --git a/src/libraries/System.Net.Quic/tests/FunctionalTests/System.Net.Quic.Tests.csproj b/src/libraries/System.Net.Quic/tests/FunctionalTests/System.Net.Quic.Tests.csproj
deleted file mode 100644
index aa9c1bea18b..00000000000
--- a/src/libraries/System.Net.Quic/tests/FunctionalTests/System.Net.Quic.Tests.csproj
+++ /dev/null
@@ -1,19 +0,0 @@
-<Project Sdk="Microsoft.NET.Sdk">
- <PropertyGroup>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <TargetFrameworks>$(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Unix</TargetFrameworks>
- </PropertyGroup>
- <ItemGroup>
- <Compile Include="MsQuicTestBase.cs" />
- <Compile Include="MsQuicTests.cs" />
- <Compile Include="QuicConnectionTests.cs" />
- <Compile Include="$(CommonTestPath)System\Diagnostics\Tracing\ConsoleEventListener.cs">
- <Link>Common\System\Diagnostics\Tracing\ConsoleEventListener.cs</Link>
- </Compile>
- <Compile Include="$(CommonTestPath)\System\Threading\Tasks\TaskTimeoutExtensions.cs">
- <Link>Common\System\Threading\Tasks\TaskTimeoutExtensions.cs</Link>
- </Compile>
- <Compile Include="QuicListenerTests.cs" />
- <Compile Include="QuicStreamTests.cs" />
- </ItemGroup>
-</Project> \ No newline at end of file