Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions src/libraries/System.Net.Http/src/System.Net.Http.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
<ItemGroup>
<ILLinkSubstitutionsXmls Include="$(ILLinkDirectory)ILLink.Substitutions.xml" />
</ItemGroup>

<ItemGroup>
<Compile Include="System\Net\Http\ByteArrayContent.cs" />
<Compile Include="System\Net\Http\ByteArrayHelpers.cs" />
Expand Down Expand Up @@ -662,20 +661,6 @@
<ItemGroup Condition=" '$(TargetsBrowser)' == 'true'">
<ProjectReference Include="$(LibrariesProjectRoot)System.Private.Runtime.InteropServices.JavaScript\src\System.Private.Runtime.InteropServices.JavaScript.csproj" />
</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>
Expand Down
20 changes: 20 additions & 0 deletions src/libraries/System.Net.Http/tests/UnitTests/HttpClientTest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System.IO;
using System.Reflection;
using System.Threading.Tasks;
using Xunit;

namespace System.Net.Http.Tests
{
public class HttpClientTest
{
[Fact]
public async Task GetAsync_Succeeds()
Comment thread
marek-safar marked this conversation as resolved.
Outdated
Comment thread
ManickaP marked this conversation as resolved.
Outdated
{
using var client = new HttpClient();
using var response = await client.GetAsync(Configuration.Http.RemoteServer);
}
}
}
185 changes: 94 additions & 91 deletions src/libraries/System.Net.Quic/ref/System.Net.Quic.cs

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/libraries/System.Net.Quic/src/ExcludeApiList.PNSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
T:System.Net.Quic.QuicImplementationProviders
5 changes: 5 additions & 0 deletions src/libraries/System.Net.Quic/src/System.Net.Quic.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,13 @@
<!-- DesignTimeBuild requires all the TargetFramework Derived Properties to not be present in the first property group. -->
<PropertyGroup>
<GeneratePlatformNotSupportedAssemblyMessage Condition="'$(TargetsAnyOS)' == 'true'">SR.SystemNetQuic_PlatformNotSupported</GeneratePlatformNotSupportedAssemblyMessage>
<ApiExclusionListPath Condition="'$(TargetsAnyOS)' == 'true'">ExcludeApiList.PNSE.txt</ApiExclusionListPath>
</PropertyGroup>
<!-- Source files -->
<ItemGroup Condition="'$(TargetsAnyOS)' == 'true'">
<Compile Include="System\Net\Quic\Implementations\NoQuic\*.cs" />
</ItemGroup>
<!-- Source files -->
<ItemGroup Condition="'$(TargetsAnyOS)' != 'true'">
<Compile Include="System\Net\Quic\*.cs" />
<Compile Include="System\Net\Quic\Implementations\*.cs" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

namespace System.Net.Quic.Implementations.NoQuic
{
internal sealed class NoQuicImplementationProvider : QuicImplementationProvider
{
public override bool IsSupported => false;
Copy link
Copy Markdown
Contributor Author

@marek-safar marek-safar Mar 24, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The linker won't be able to see this logic so the change no longer fixes #46915 issue. It will also trigger a platform compatibility warning which is probably not desirable which cannot be fix without pragma.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The linker won't be able to see this logic so the change no longer fixes #46915 issue.

I'll try to fix that, but I need a way how to test it and confirm it work as it should. ATM, I don't even know how the desired result looks let alone be able to confirm it.

It will also trigger a platform compatibility warning

How can I test this?

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

namespace System.Net.Quic
{
public static partial class QuicImplementationProviders
{
public static Implementations.QuicImplementationProvider NoQuic { get; } = new Implementations.NoQuic.NoQuicImplementationProvider();
public static Implementations.QuicImplementationProvider Default => NoQuic;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ internal QuicImplementationProvider() { }

public abstract bool IsSupported { get; }

internal abstract QuicListenerProvider CreateListener(QuicListenerOptions options);
internal virtual QuicListenerProvider CreateListener(QuicListenerOptions options)
=> throw new NotImplementedException();

internal abstract QuicConnectionProvider CreateConnection(QuicClientConnectionOptions options);
internal virtual QuicConnectionProvider CreateConnection(QuicClientConnectionOptions options)
=> throw new NotImplementedException();
}
}