diff --git a/src/System.Net.Http/ref/System.Net.Http.SocketsHttpHandler.cs b/src/System.Net.Http/ref/System.Net.Http.SocketsHttpHandler.cs new file mode 100644 index 000000000000..349c71e1a8bf --- /dev/null +++ b/src/System.Net.Http/ref/System.Net.Http.SocketsHttpHandler.cs @@ -0,0 +1,35 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. +// ------------------------------------------------------------------------------ +// Changes to this file must follow the http://aka.ms/api-review process. +// ------------------------------------------------------------------------------ + + +namespace System.Net.Http +{ + public sealed class SocketsHttpHandler : HttpMessageHandler + { + public SocketsHttpHandler() { } + public bool AllowAutoRedirect { get { throw null; } set { } } + public System.Net.DecompressionMethods AutomaticDecompression { get { throw null; } set { } } + public System.TimeSpan ConnectTimeout { get; set; } + public System.Net.CookieContainer CookieContainer { get { throw null; } set { } } + public System.Net.ICredentials Credentials { get { throw null; } set { } } + public System.Net.ICredentials DefaultProxyCredentials { get { throw null; } set { } } + public System.TimeSpan Expect100ContinueTimeout { get; set; } + public int MaxAutomaticRedirections { get { throw null; } set { } } + public int MaxConnectionsPerServer { get { throw null; } set { } } + public int MaxResponseHeadersLength { get { throw null; } set { } } + public bool PreAuthenticate { get { throw null; } set { } } + public System.TimeSpan PooledConnectionIdleTimeout { get { throw null; } set { } } + public System.TimeSpan PooledConnectionLifetime { get { throw null; } set { } } + public System.Collections.Generic.IDictionary Properties { get { throw null; } } + public System.Net.IWebProxy Proxy { get { throw null; } set { } } + public System.Net.Security.SslClientAuthenticationOptions SslOptions { get { throw null; } set { } } + public bool UseCookies { get { throw null; } set { } } + public bool UseProxy { get { throw null; } set { } } + protected override void Dispose(bool disposing) { } + protected internal override System.Threading.Tasks.Task SendAsync(System.Net.Http.HttpRequestMessage request, System.Threading.CancellationToken cancellationToken) { throw null; } + } +} diff --git a/src/System.Net.Http/ref/System.Net.Http.cs b/src/System.Net.Http/ref/System.Net.Http.cs index a6883e8a6ba7..5bfa47a7e322 100644 --- a/src/System.Net.Http/ref/System.Net.Http.cs +++ b/src/System.Net.Http/ref/System.Net.Http.cs @@ -236,30 +236,6 @@ public ReadOnlyMemoryContent(System.ReadOnlyMemory content) { } protected override System.Threading.Tasks.Task SerializeToStreamAsync(System.IO.Stream stream, System.Net.TransportContext context) => throw null; protected internal override bool TryComputeLength(out long length) => throw null; } - public sealed class SocketsHttpHandler : HttpMessageHandler - { - public SocketsHttpHandler() { } - public bool AllowAutoRedirect { get { throw null; } set { } } - public System.Net.DecompressionMethods AutomaticDecompression { get { throw null; } set { } } - public System.TimeSpan ConnectTimeout { get; set; } - public System.Net.CookieContainer CookieContainer { get { throw null; } set { } } - public System.Net.ICredentials Credentials { get { throw null; } set { } } - public System.Net.ICredentials DefaultProxyCredentials { get { throw null; } set { } } - public System.TimeSpan Expect100ContinueTimeout { get; set; } - public int MaxAutomaticRedirections { get { throw null; } set { } } - public int MaxConnectionsPerServer { get { throw null; } set { } } - public int MaxResponseHeadersLength { get { throw null; } set { } } - public bool PreAuthenticate { get { throw null; } set { } } - public System.TimeSpan PooledConnectionIdleTimeout { get { throw null; } set { } } - public System.TimeSpan PooledConnectionLifetime { get { throw null; } set { } } - public System.Collections.Generic.IDictionary Properties { get { throw null; } } - public System.Net.IWebProxy Proxy { get { throw null; } set { } } - public System.Net.Security.SslClientAuthenticationOptions SslOptions { get { throw null; } set { } } - public bool UseCookies { get { throw null; } set { } } - public bool UseProxy { get { throw null; } set { } } - protected override void Dispose(bool disposing) { } - protected internal override System.Threading.Tasks.Task SendAsync(System.Net.Http.HttpRequestMessage request, System.Threading.CancellationToken cancellationToken) { throw null; } - } public partial class StreamContent : System.Net.Http.HttpContent { public StreamContent(System.IO.Stream content) { } diff --git a/src/System.Net.Http/ref/System.Net.Http.csproj b/src/System.Net.Http/ref/System.Net.Http.csproj index ffad024b4207..22d42f76d846 100644 --- a/src/System.Net.Http/ref/System.Net.Http.csproj +++ b/src/System.Net.Http/ref/System.Net.Http.csproj @@ -10,6 +10,7 @@ + diff --git a/src/System.Net.Http/src/System/Net/Http/HttpClientHandler.Core.cs b/src/System.Net.Http/src/System/Net/Http/HttpClientHandler.Core.cs index ce586eaa8004..9c1bb256575a 100644 --- a/src/System.Net.Http/src/System/Net/Http/HttpClientHandler.Core.cs +++ b/src/System.Net.Http/src/System/Net/Http/HttpClientHandler.Core.cs @@ -62,12 +62,5 @@ private void CheckDisposedOrStarted() throw new InvalidOperationException(SR.net_http_operation_started); } } - - private void ThrowForModifiedManagedSslOptionsIfStarted() - { - // Hack to trigger an InvalidOperationException if a property that's stored on - // SslOptions is changed, since SslOptions itself does not do any such checks. - _socketsHttpHandler.SslOptions = _socketsHttpHandler.SslOptions; - } } } diff --git a/src/System.Net.Http/src/System/Net/Http/HttpClientHandler.Unix.cs b/src/System.Net.Http/src/System/Net/Http/HttpClientHandler.Unix.cs index 04de3861adf2..62867295a996 100644 --- a/src/System.Net.Http/src/System/Net/Http/HttpClientHandler.Unix.cs +++ b/src/System.Net.Http/src/System/Net/Http/HttpClientHandler.Unix.cs @@ -375,6 +375,13 @@ public int MaxResponseHeadersLength } } + private void ThrowForModifiedManagedSslOptionsIfStarted() + { + // Hack to trigger an InvalidOperationException if a property that's stored on + // SslOptions is changed, since SslOptions itself does not do any such checks. + _socketsHttpHandler.SslOptions = _socketsHttpHandler.SslOptions; + } + public IDictionary Properties => _curlHandler != null ? _curlHandler.Properties : _socketsHttpHandler.Properties; diff --git a/src/System.Net.Http/src/System/Net/Http/HttpClientHandler.Windows.cs b/src/System.Net.Http/src/System/Net/Http/HttpClientHandler.Windows.cs index 0c3e7d4ad59c..7484c371bbd6 100644 --- a/src/System.Net.Http/src/System/Net/Http/HttpClientHandler.Windows.cs +++ b/src/System.Net.Http/src/System/Net/Http/HttpClientHandler.Windows.cs @@ -463,5 +463,13 @@ protected internal override Task SendAsync(HttpRequestMessa _socketsHttpHandler.SendAsync(request, cancellationToken); } } + + private void ThrowForModifiedManagedSslOptionsIfStarted() + { + // Hack to trigger an InvalidOperationException if a property that's stored on + // SslOptions is changed, since SslOptions itself does not do any such checks. + _socketsHttpHandler.SslOptions = _socketsHttpHandler.SslOptions; + } + } }