From a1a9f49ee8eabd8799cdb3b6f4e8b019c247aa40 Mon Sep 17 00:00:00 2001 From: Matt Mitchell Date: Tue, 27 Jul 2021 07:57:07 -0700 Subject: [PATCH] Revert "Split mobile specific ILLink.Substitutions into its own file (#56306)" This reverts commit ae413d9a81ede4cd7c624d7ec7792c16ad8b8f21. --- .../src/ILLink/ILLink.Substitutions.mobile.xml | 7 ------- .../src/ILLink/ILLink.Substitutions.xml | 3 +++ .../System.Net.Http/src/System.Net.Http.csproj | 4 +--- .../System.Net.Http/src/System/Net/Http/HttpClient.cs | 10 ++++++++++ 4 files changed, 14 insertions(+), 10 deletions(-) delete mode 100644 src/libraries/System.Net.Http/src/ILLink/ILLink.Substitutions.mobile.xml diff --git a/src/libraries/System.Net.Http/src/ILLink/ILLink.Substitutions.mobile.xml b/src/libraries/System.Net.Http/src/ILLink/ILLink.Substitutions.mobile.xml deleted file mode 100644 index 5b705abeb24bd..0000000000000 --- a/src/libraries/System.Net.Http/src/ILLink/ILLink.Substitutions.mobile.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/src/libraries/System.Net.Http/src/ILLink/ILLink.Substitutions.xml b/src/libraries/System.Net.Http/src/ILLink/ILLink.Substitutions.xml index 5e70f6fbb5d7d..8af1dcbdfa8a6 100644 --- a/src/libraries/System.Net.Http/src/ILLink/ILLink.Substitutions.xml +++ b/src/libraries/System.Net.Http/src/ILLink/ILLink.Substitutions.xml @@ -3,5 +3,8 @@ + + + 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 77ed5b9c436c6..330c6cf161446 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 @@ - + win true @@ -18,8 +18,6 @@ - diff --git a/src/libraries/System.Net.Http/src/System/Net/Http/HttpClient.cs b/src/libraries/System.Net.Http/src/System/Net/Http/HttpClient.cs index 3b77aeafc0467..2e1434b0b4993 100644 --- a/src/libraries/System.Net.Http/src/System/Net/Http/HttpClient.cs +++ b/src/libraries/System.Net.Http/src/System/Net/Http/HttpClient.cs @@ -815,6 +815,16 @@ private void PrepareRequestMessage(HttpRequestMessage request) return (pendingRequestsCts, DisposeTokenSource: false, pendingRequestsCts); } + private static bool IsNativeHandlerEnabled() + { + if (!AppContext.TryGetSwitch("System.Net.Http.UseNativeHttpHandler", out bool isEnabled)) + { + return false; + } + + return isEnabled; + } + private Uri? CreateUri(string? uri) => string.IsNullOrEmpty(uri) ? null : new Uri(uri, UriKind.RelativeOrAbsolute);