This repository has been archived by the owner on Jan 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Keep SocketsHttpHandler out of UAP builds
SocketsHttpHandler is not supported in uap and is currently leaking into UAP builds since they've been disabled for a few weeks. Adjust the contract so it's not available to UAP, and clean the implementation assembly so SocketsHttpHandler internals don't leak out into HttpClientHandler.Core.cs.
- Loading branch information
Showing
6 changed files
with
51 additions
and
31 deletions.
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
src/System.Net.Http/ref/System.Net.Http.SocketsHttpHandler.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<string, object> 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<System.Net.Http.HttpResponseMessage> SendAsync(System.Net.Http.HttpRequestMessage request, System.Threading.CancellationToken cancellationToken) { throw null; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -463,5 +463,13 @@ protected internal override Task<HttpResponseMessage> 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; | ||
} | ||
This comment has been minimized.
Sorry, something went wrong.
stephentoub
Member
|
||
|
||
} | ||
} |
1 comment
on commit 30d10f5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a higher-level question: should we just start building SocketsHttpHandler for uap as well? Is there something blocking us from doing so?
Can we use a more generic name for things that shouldn't be in uap?