From cab561407954c920092ec9b18d93e1880b85bd05 Mon Sep 17 00:00:00 2001 From: Steve Pfister Date: Mon, 26 Jul 2021 10:52:48 -0400 Subject: [PATCH 1/2] Split mobile specific ILLink.Substitutions into its own file It was discovered in https://github.com/dotnet/runtime/pull/56161 that mobile specific HttpClientHandler substitutions were sticking around even for non mobile builds. This change moves the substitution into ILLink.Substitutions.mobile.xml. --- .../src/ILLink/ILLink.Substitutions.mobile.xml | 7 +++++++ .../System.Net.Http/src/ILLink/ILLink.Substitutions.xml | 3 --- src/libraries/System.Net.Http/src/System.Net.Http.csproj | 4 +++- 3 files changed, 10 insertions(+), 4 deletions(-) create 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 new file mode 100644 index 00000000000000..5b705abeb24bda --- /dev/null +++ b/src/libraries/System.Net.Http/src/ILLink/ILLink.Substitutions.mobile.xml @@ -0,0 +1,7 @@ + + + + + + + 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 8af1dcbdfa8a6a..5e70f6fbb5d7d5 100644 --- a/src/libraries/System.Net.Http/src/ILLink/ILLink.Substitutions.xml +++ b/src/libraries/System.Net.Http/src/ILLink/ILLink.Substitutions.xml @@ -3,8 +3,5 @@ - - - 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 330c6cf1614468..77ed5b9c436c64 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,6 +18,8 @@ + From ecc03b3705a293f473c40c0a7056e9f2bbc05889 Mon Sep 17 00:00:00 2001 From: Steve Pfister Date: Mon, 26 Jul 2021 12:09:25 -0400 Subject: [PATCH 2/2] Remove unneeded method from HttpClient --- .../System.Net.Http/src/System/Net/Http/HttpClient.cs | 10 ---------- 1 file changed, 10 deletions(-) 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 2e1434b0b49935..3b77aeafc0467b 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,16 +815,6 @@ 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);