Skip to content

Commit

Permalink
Revert "Split mobile specific ILLink.Substitutions into its own file (#…
Browse files Browse the repository at this point in the history
…56306)"

This reverts commit ae413d9.
  • Loading branch information
mmitche committed Jul 27, 2021
1 parent 1fa7e38 commit a1a9f49
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 10 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,8 @@
<type fullname="System.Net.Http.DiagnosticsHandler">
<method signature="System.Boolean IsGloballyEnabled()" body="stub" value="false" feature="System.Net.Http.EnableActivityPropagation" featurevalue="false" />
</type>
<type fullname="System.Net.Http.HttpClientHandler">
<method signature="System.Boolean get_IsNativeHandlerEnabled()" body="stub" value="false" feature="System.Net.Http.UseNativeHttpHandler" featurevalue="false" />
</type>
</assembly>
</linker>
4 changes: 1 addition & 3 deletions src/libraries/System.Net.Http/src/System.Net.Http.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<WindowsRID>win</WindowsRID>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
Expand All @@ -18,8 +18,6 @@
</PropertyGroup>
<ItemGroup>
<ILLinkSubstitutionsXmls Include="$(ILLinkDirectory)ILLink.Substitutions.xml" />
<ILLinkSubstitutionsXmls Condition="'$(TargetsAndroid)' == 'true' or '$(TargetsiOS)' == 'true' or '$(TargetsMacCatalyst)' == 'true' or '$(TargetsTVOS)' == 'true'"
Include="$(ILLinkDirectory)ILLink.Substitutions.mobile.xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="System\Net\Http\ByteArrayContent.cs" />
Expand Down
10 changes: 10 additions & 0 deletions src/libraries/System.Net.Http/src/System/Net/Http/HttpClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit a1a9f49

Please sign in to comment.