Skip to content

Commit

Permalink
Add temporary workaround for internal StreamContent constructor.
Browse files Browse the repository at this point in the history
(cherry picked from commit 23762ef)
  • Loading branch information
Martin Baulig authored and akoeplinger committed Apr 5, 2019
1 parent 9eb2dbf commit 7ecc538
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 1 deletion.
2 changes: 1 addition & 1 deletion external/corefx
19 changes: 19 additions & 0 deletions mcs/class/System.Net.Http/StreamContent.Mono.cs
@@ -0,0 +1,19 @@
using System.IO;
using System.Threading;

namespace System.Net.Http
{
partial class StreamContent
{
//
// Workarounds for poor .NET API
// Instead of having SerializeToStreamAsync with CancellationToken as public API. Only LoadIntoBufferAsync
// called internally from the send worker can be cancelled and user cannot see/do it
//
[Obsolete ("FIXME: Please talk to Martin about this; see https://github.com/mono/mono/issues/12996.")]
internal StreamContent (Stream content, CancellationToken cancellationToken)
: this (content)
{
}
}
}
3 changes: 3 additions & 0 deletions mcs/class/System.Net.Http/System.Net.Http.csproj
Expand Up @@ -604,6 +604,7 @@
<Compile Include="HttpClientHandler.cs" />
<Compile Include="IMonoHttpClientHandler.cs" />
<Compile Include="MonoWebRequestHandler.cs" />
<Compile Include="StreamContent.Mono.cs" />
<Compile Include="corefx\NetEventSource.Http.cs" />
<Compile Include="corefx\SocketsHttpHandler.Mono.cs" />
</ItemGroup>
Expand Down Expand Up @@ -718,6 +719,7 @@
<Compile Include="HttpClientHandler.cs" />
<Compile Include="IMonoHttpClientHandler.cs" />
<Compile Include="MonoWebRequestHandler.cs" />
<Compile Include="StreamContent.Mono.cs" />
<Compile Include="corefx\NetEventSource.Http.cs" />
<Compile Include="corefx\SocketsHttpHandler.Mono.cs" />
</ItemGroup>
Expand Down Expand Up @@ -832,6 +834,7 @@
<Compile Include="HttpClientHandler.cs" />
<Compile Include="IMonoHttpClientHandler.cs" />
<Compile Include="MonoWebRequestHandler.cs" />
<Compile Include="StreamContent.Mono.cs" />
<Compile Include="corefx\NetEventSource.Http.cs" />
<Compile Include="corefx\SocketsHttpHandler.Mono.cs" />
</ItemGroup>
Expand Down
Expand Up @@ -5,6 +5,7 @@ HttpClientHandler.cs
HttpClientHandler.SocketsHandler.cs
IMonoHttpClientHandler.cs
MonoWebRequestHandler.cs
StreamContent.Mono.cs

../corlib/System.Diagnostics/Debug.cs

Expand Down

0 comments on commit 7ecc538

Please sign in to comment.