Imported Upstream version 5.4.0.167

Former-commit-id: 5624ac747d633e885131e8349322922b6a59baaa
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2017-08-21 15:34:15 +00:00
parent e49d6f06c0
commit 536cd135cc
12856 changed files with 563812 additions and 223249 deletions

View File

@@ -5,8 +5,6 @@
//------------------------------------------------------------------------------
namespace System.Net {
#if SECURITY_DEP
public delegate AuthenticationSchemes AuthenticationSchemeSelector(HttpListenerRequest httpRequest);
#endif
}

View File

@@ -902,7 +902,7 @@ namespace System.Net.Cache {
// These if-else are two logically identical blocks that differ only in the way of how text search is done.
// The text search is done differently for 32 and X-bits platforms.
// ATTN: You are responsible for keeping the rest of the logic in [....].
// ATTN: You are responsible for keeping the rest of the logic in sync.
if (IntPtr.Size == 4) {
// We are on 32-bits platform

View File

@@ -51,7 +51,7 @@ namespace Microsoft.Win32 {
***********/
// Per VsWhidbey#88276 it was decided to not enforce any cache metadata limits for WinInet cache provider.
// ([....] 7/17 made this a const to avoid threading issues)
// (Microsoft 7/17 made this a const to avoid threading issues)
//_MaximumResponseHeadersLength = Int32.MaxValue;
this.async = async;

View File

@@ -32,7 +32,7 @@ namespace System.Net.Cache {
BypassCache = 1,
// Only serve requests from cache, an exception is thrown if not found
CacheOnly = 2,
// Serve from the cache, but will [....] up with the server if not found
// Serve from the cache, but will sync up with the server if not found
CacheIfAvailable = 3,
// Attempt to revalidate cache with the server, reload if unable to
Revalidate = 4,
@@ -105,7 +105,7 @@ namespace System.Net.Cache {
BypassCache = 1,
// Only serve requests from cache, an exception is thrown if not found
CacheOnly = 2,
// Serve from the cache, but will [....] up with the server if not found
// Serve from the cache, but will sync up with the server if not found
CacheIfAvailable = 3,
// Validate cached data with the server even if it looks fresh
Revalidate = 4,

View File

@@ -118,7 +118,7 @@ namespace System.Net.Configuration
// This allows us to prevent parent settings (machine.config) from propegating to higher config (app.config), unless
// the higher config doesn't contain the section at all. That is, overriding defaultProxy is all-or-nothing.
// Template from [....].
// Template from Microsoft.
protected override void Reset(ConfigurationElement parentElement)
{
// Ignore the parentElement parameter by changing it to the default settings

View File

@@ -3,7 +3,7 @@ namespace System.Net {
using System.Configuration;
using System.ComponentModel;
// NOTE [[....]]: The old validation attribute was removed from System.ll and is
// NOTE [Microsoft]: The old validation attribute was removed from System.ll and is
// replaced by more flexible and robust validation/conversion design.
// The change bellow is a simple fix to make things work with the least possible change ( it is an integration break )
// However, we already have a built-in support for configuration properties that store
@@ -32,7 +32,7 @@ namespace System.Net {
return;
if (timeout <= 0 && timeout != System.Threading.Timeout.Infinite) {
// Note [[....]] : This is a lab integration fix. Old code did not have any error message at this point
// Note [Microsoft] : This is a lab integration fix. Old code did not have any error message at this point
// This code change accomplishes the same result. However its highly reccomended that a specific error message is givven
// to the user so they know what exaclty is the problem ( i.e. the value must be a positive integer or be Infinite )
// To accomplish this - an exception with the specific error message could be thrown ( ArgumentException is prefferred )

View File

@@ -1320,7 +1320,7 @@ namespace System.Net {
}
}
// Return null only on [....] (if we're on the [....] thread). Otherwise throw if no context is available.
// Return null only on Sync (if we're on the Sync thread). Otherwise throw if no context is available.
//
//
@@ -1331,7 +1331,7 @@ namespace System.Net {
else if (m_WriteAsyncResult != null)
return m_WriteAsyncResult;
// [....].
// Sync.
GlobalLog.ThreadContract(ThreadKinds.User | ThreadKinds.Sync, "FtpWebRequest#" + ValidationHelper.HashString(this) + "::GetWritingContext");
return null;
}
@@ -1339,7 +1339,7 @@ namespace System.Net {
//
// Provides an abstract way of having Async code callback into the request (saves a delegate)
//
// ATTN this method is also called on [....] path when either command or data stream gets closed
// ATTN this method is also called on sync path when either command or data stream gets closed
// Consider: Revisit the design of ftp streams
//
internal override void RequestCallback(object obj)
@@ -1350,7 +1350,7 @@ namespace System.Net {
SyncRequestCallback(obj);
}
//
// Only executed for [....] requests when the pipline is completed
// Only executed for Sync requests when the pipline is completed
//
private void SyncRequestCallback(object obj)
{
@@ -1389,7 +1389,7 @@ namespace System.Net {
isRevalidatedOrRetried =!m_CacheDone &&
(CacheProtocol.ProtocolStatus == CacheValidationStatus.Continue || CacheProtocol.ProtocolStatus == CacheValidationStatus.RetryResponseFromServer);
// This is for [....] Upload commands that do not get chance hit GetResponse loop
// This is for sync Upload commands that do not get chance hit GetResponse loop
if (m_MethodInfo.IsUpload)
{
CheckCacheRetrieveOnResponse();

View File

@@ -303,6 +303,8 @@ namespace System.Net {
// Note: RequestBuffer may get moved in memory. If you dereference a pointer from inside the RequestBuffer,
// you must use 'OriginalBlobAddress' below to adjust the location of the pointer to match the location of
// RequestBuffer.
//
internal byte[] RequestBuffer
{
get
@@ -1017,7 +1019,7 @@ namespace System.Net {
}
internal IEnumerable<TokenBinding> GetTlsTokenBindings() {
// Try to get the token binding if not created.
if (Volatile.Read(ref m_TokenBindings) == null)
{
@@ -1063,10 +1065,18 @@ namespace System.Net {
}
m_TokenBindings = new List<TokenBinding>();
UnsafeNclNativeMethods.HttpApi.HTTP_REQUEST_TOKEN_BINDING_INFO* pTokenBindingInfo = UnsafeNclNativeMethods.HttpApi.GetTlsTokenBindingRequestInfo(RequestBuffer, OriginalBlobAddress);
UnsafeNclNativeMethods.HttpApi.HTTP_REQUEST_TOKEN_BINDING_INFO_V1* pTokenBindingInfo_V1 = null;
bool useV1TokenBinding = false;
// Only try to collect the old binding information if there is no V2 binding information available
if (pTokenBindingInfo == null)
{
pTokenBindingInfo_V1 = UnsafeNclNativeMethods.HttpApi.GetTlsTokenBindingRequestInfo_V1(RequestBuffer, OriginalBlobAddress);
useV1TokenBinding = true;
}
if (pTokenBindingInfo == null && pTokenBindingInfo_V1 == null)
{
// The current request isn't over TLS or the client or server doesn't support the token binding
// protocol. This isn't an error; just return "nothing here".
@@ -1075,13 +1085,35 @@ namespace System.Net {
UnsafeNclNativeMethods.HttpApi.HeapAllocHandle handle = null;
m_TokenBindingVerifyMessageStatus = -1;
m_TokenBindingVerifyMessageStatus = UnsafeNclNativeMethods.HttpApi.TokenBindingVerifyMessage(
pTokenBindingInfo->TokenBinding,
pTokenBindingInfo->TokenBindingSize,
pTokenBindingInfo->KeyType,
pTokenBindingInfo->TlsUnique,
pTokenBindingInfo->TlsUniqueSize,
out handle);
fixed (byte* pMemoryBlob = RequestBuffer){
UnsafeNclNativeMethods.HttpApi.HTTP_REQUEST_V2* request = (UnsafeNclNativeMethods.HttpApi.HTTP_REQUEST_V2*)pMemoryBlob;
long fixup = pMemoryBlob - (byte*) OriginalBlobAddress;
if (useV1TokenBinding && pTokenBindingInfo_V1 != null)
{
// Old V1 Token Binding protocol is still being used, so we need to verify the binding message using the old API
m_TokenBindingVerifyMessageStatus = UnsafeNclNativeMethods.HttpApi.TokenBindingVerifyMessage_V1(
pTokenBindingInfo_V1->TokenBinding + fixup,
pTokenBindingInfo_V1->TokenBindingSize,
(IntPtr)((byte*)(pTokenBindingInfo_V1->KeyType) + fixup),
pTokenBindingInfo_V1->TlsUnique + fixup,
pTokenBindingInfo_V1->TlsUniqueSize,
out handle);
}
else
{
// Use the V2 token binding behavior
m_TokenBindingVerifyMessageStatus =
UnsafeNclNativeMethods.HttpApi.TokenBindingVerifyMessage(
pTokenBindingInfo->TokenBinding + fixup,
pTokenBindingInfo->TokenBindingSize,
pTokenBindingInfo->KeyType,
pTokenBindingInfo->TlsUnique + fixup,
pTokenBindingInfo->TlsUniqueSize,
out handle);
}
}
if (m_TokenBindingVerifyMessageStatus != 0)
{
@@ -1093,27 +1125,74 @@ namespace System.Net {
using (handle)
{
UnsafeNclNativeMethods.HttpApi.TOKENBINDING_RESULT_LIST* pResultList = (UnsafeNclNativeMethods.HttpApi.TOKENBINDING_RESULT_LIST*)handle.DangerousGetHandle();
for (int i = 0; i < pResultList->resultCount; i++)
// If we have an old binding, use the old binding behavior
if (useV1TokenBinding)
{
UnsafeNclNativeMethods.HttpApi.TOKENBINDING_RESULT_DATA* pThisResultData = &pResultList->resultData[i];
GenerateTokenBindings_V1(handle);
}
else
{
GenerateTokenBindings(handle);
}
}
}
if (pThisResultData != null)
/// <summary>
/// Method to allow current bindings to be returned
/// </summary>
/// <param name="handle"></param>
private void GenerateTokenBindings(UnsafeNclNativeMethods.HttpApi.HeapAllocHandle handle)
{
UnsafeNclNativeMethods.HttpApi.TOKENBINDING_RESULT_LIST* pResultList = (UnsafeNclNativeMethods.HttpApi.TOKENBINDING_RESULT_LIST*)handle.DangerousGetHandle();
for (int i = 0; i < pResultList->resultCount; i++)
{
UnsafeNclNativeMethods.HttpApi.TOKENBINDING_RESULT_DATA* pThisResultData = &pResultList->resultData[i];
if (pThisResultData != null)
{
byte[] retVal = new byte[pThisResultData->identifierSize];
Marshal.Copy((IntPtr)(pThisResultData->identifierData), retVal, 0, retVal.Length);
if (pThisResultData->bindingType == UnsafeNclNativeMethods.HttpApi.TOKENBINDING_TYPE.TOKENBINDING_TYPE_PROVIDED)
{
// Per http://tools.ietf.org/html/draft-ietf-tokbind-protocol-00, Sec. 4,
// We'll strip off the token binding type and return the remainder as an opaque blob.
Debug.Assert((long)(&pThisResultData->identifierData->hashAlgorithm) == (long)(pThisResultData->identifierData) + 1);
byte[] retVal = new byte[pThisResultData->identifierSize - 1];
Marshal.Copy((IntPtr)(&pThisResultData->identifierData->hashAlgorithm), retVal, 0, retVal.Length);
m_TokenBindings.Add(new TokenBinding(TokenBindingType.Provided, retVal));
}
else if (pThisResultData->bindingType == UnsafeNclNativeMethods.HttpApi.TOKENBINDING_TYPE.TOKENBINDING_TYPE_REFERRED)
{
m_TokenBindings.Add(new TokenBinding(TokenBindingType.Referred, retVal));
}
}
}
}
if (pThisResultData->identifierData->bindingType == UnsafeNclNativeMethods.HttpApi.TOKENBINDING_TYPE.TOKENBINDING_TYPE_PROVIDED)
{
m_TokenBindings.Add(new TokenBinding(TokenBindingType.Provided, retVal));
}
else if (pThisResultData->identifierData->bindingType == UnsafeNclNativeMethods.HttpApi.TOKENBINDING_TYPE.TOKENBINDING_TYPE_REFERRED)
{
m_TokenBindings.Add(new TokenBinding(TokenBindingType.Referred, retVal));
}
/// <summary>
/// Compat method to allow V1 bindings to be returned
/// </summary>
/// <param name="handle"></param>
private void GenerateTokenBindings_V1(UnsafeNclNativeMethods.HttpApi.HeapAllocHandle handle)
{
UnsafeNclNativeMethods.HttpApi.TOKENBINDING_RESULT_LIST_V1* pResultList = (UnsafeNclNativeMethods.HttpApi.TOKENBINDING_RESULT_LIST_V1*)handle.DangerousGetHandle();
for (int i = 0; i < pResultList->resultCount; i++)
{
UnsafeNclNativeMethods.HttpApi.TOKENBINDING_RESULT_DATA_V1* pThisResultData = &pResultList->resultData[i];
if (pThisResultData != null)
{
// Old V1 Token Binding protocol is still being used, so we need modify the binding message using the old behavior
// Per http://tools.ietf.org/html/draft-ietf-tokbind-protocol-00, Sec. 4,
// We'll strip off the token binding type and return the remainder as an opaque blob.
Debug.Assert((long)(&pThisResultData->identifierData->hashAlgorithm) == (long)(pThisResultData->identifierData) + 1 );
byte[] retVal = new byte[pThisResultData->identifierSize - 1];
Marshal.Copy((IntPtr)(&pThisResultData->identifierData->hashAlgorithm), retVal, 0, retVal.Length);
if (pThisResultData->identifierData->bindingType == UnsafeNclNativeMethods.HttpApi.TOKENBINDING_TYPE.TOKENBINDING_TYPE_PROVIDED)
{
m_TokenBindings.Add(new TokenBinding(TokenBindingType.Provided, retVal));
}
else if (pThisResultData->identifierData->bindingType == UnsafeNclNativeMethods.HttpApi.TOKENBINDING_TYPE.TOKENBINDING_TYPE_REFERRED)
{
m_TokenBindings.Add(new TokenBinding(TokenBindingType.Referred, retVal));
}
}
}

View File

@@ -1 +1 @@
7fe34ea4335b86d1210c62e32cc066f38862cc62
76e37ecea7280b26773068f73834b6033eb1d5d9

View File

@@ -446,7 +446,7 @@ namespace System.Net {
}
//
// A simple [....] point, useful for deferring work. Just an int value with helper methods.
// A simple sync point, useful for deferring work. Just an int value with helper methods.
// This is used by HttpWebRequest to syncronize Reads/Writes while waiting for a 100-Continue response.
//
internal struct InterlockedGate

View File

@@ -93,7 +93,7 @@ using System.Security.Principal;
TokenImpersonationLevel allowedImpersonationLevel)
{
#if DEBUG
using (GlobalLog.SetThreadKind(ThreadKinds.User | ThreadKinds.[....])) {
using (GlobalLog.SetThreadKind(ThreadKinds.User | ThreadKinds.Sync)) {
#endif
_NegoState.ValidateCreateContext(_Package, false, credential, targetName, binding, requiredProtectionLevel, allowedImpersonationLevel);
_NegoState.ProcessAuthentication(null);
@@ -199,7 +199,7 @@ using System.Security.Principal;
TokenImpersonationLevel requiredImpersonationLevel)
{
#if DEBUG
using (GlobalLog.SetThreadKind(ThreadKinds.User | ThreadKinds.[....])) {
using (GlobalLog.SetThreadKind(ThreadKinds.User | ThreadKinds.Sync)) {
#endif
_NegoState.ValidateCreateContext(_Package, credential, string.Empty, policy, requiredProtectionLevel, requiredImpersonationLevel);
@@ -503,7 +503,7 @@ using System.Security.Principal;
// Should this not block?
public override void Flush() {
#if DEBUG
using (GlobalLog.SetThreadKind(ThreadKinds.User | ThreadKinds.[....])) {
using (GlobalLog.SetThreadKind(ThreadKinds.User | ThreadKinds.Sync)) {
#endif
InnerStream.Flush();
#if DEBUG
@@ -531,7 +531,7 @@ using System.Security.Principal;
public override int Read(byte[] buffer, int offset, int count)
{
#if DEBUG
using (GlobalLog.SetThreadKind(ThreadKinds.User | ThreadKinds.[....])) {
using (GlobalLog.SetThreadKind(ThreadKinds.User | ThreadKinds.Sync)) {
#endif
_NegoState.CheckThrow(true);
@@ -548,7 +548,7 @@ using System.Security.Principal;
public override void Write(byte[] buffer, int offset, int count)
{
#if DEBUG
using (GlobalLog.SetThreadKind(ThreadKinds.User | ThreadKinds.[....])) {
using (GlobalLog.SetThreadKind(ThreadKinds.User | ThreadKinds.Sync)) {
#endif
_NegoState.CheckThrow(true);

View File

@@ -76,7 +76,13 @@ using System.Net;
Md5 = (Alg.ClassHash | Alg.Any | Alg.NameMD5),
Sha1 = (Alg.ClassHash | Alg.Any | Alg.NameSHA)
Sha1 = (Alg.ClassHash | Alg.Any | Alg.NameSHA),
Sha256 = (Alg.ClassHash | Alg.Any | Alg.NameSHA256),
Sha384 = (Alg.ClassHash | Alg.Any | Alg.NameSHA384),
Sha512 = (Alg.ClassHash | Alg.Any | Alg.NameSHA512)
}
}

View File

@@ -120,24 +120,19 @@ using System.Net.Configuration;
return _userCertificateSelectionCallback(this, targetHost, localCertificates, remoteCertificate, acceptableIssuers);
}
private SslProtocols DefaultProtocols()
{
SslProtocols protocols = SslProtocols.Tls12 | SslProtocols.Tls11 | SslProtocols.Tls;
if (ServicePointManager.DisableStrongCrypto)
{
protocols = SslProtocols.Tls | SslProtocols.Ssl3;
}
return protocols;
}
//
// Client side auth
//
public virtual void AuthenticateAsClient(string targetHost)
{
AuthenticateAsClient(targetHost, new X509CertificateCollection(), DefaultProtocols(), false);
AuthenticateAsClient(targetHost, new X509CertificateCollection(), ServicePointManager.DefaultSslProtocols, false);
}
public virtual void AuthenticateAsClient(string targetHost, X509CertificateCollection clientCertificates, bool checkCertificateRevocation)
{
AuthenticateAsClient(targetHost, clientCertificates, ServicePointManager.DefaultSslProtocols, false);
}
//
public virtual void AuthenticateAsClient(string targetHost, X509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, bool checkCertificateRevocation)
{
@@ -150,9 +145,18 @@ using System.Net.Configuration;
[HostProtection(ExternalThreading=true)]
public virtual IAsyncResult BeginAuthenticateAsClient(string targetHost, AsyncCallback asyncCallback, object asyncState)
{
return BeginAuthenticateAsClient(targetHost, new X509CertificateCollection(), DefaultProtocols(), false,
return BeginAuthenticateAsClient(targetHost, new X509CertificateCollection(), ServicePointManager.DefaultSslProtocols, false,
asyncCallback, asyncState);
}
[HostProtection(ExternalThreading = true)]
public virtual IAsyncResult BeginAuthenticateAsClient(string targetHost, X509CertificateCollection clientCertificates,
bool checkCertificateRevocation, AsyncCallback asyncCallback,
object asyncState)
{
return BeginAuthenticateAsClient(targetHost, clientCertificates, ServicePointManager.DefaultSslProtocols, checkCertificateRevocation, asyncCallback, asyncState);
}
//
[HostProtection(ExternalThreading=true)]
@@ -168,7 +172,6 @@ using System.Net.Configuration;
}
//
public virtual void EndAuthenticateAsClient(IAsyncResult asyncResult)
{
_SslState.EndProcessAuthentication(asyncResult);
@@ -181,8 +184,15 @@ using System.Net.Configuration;
//
public virtual void AuthenticateAsServer(X509Certificate serverCertificate)
{
AuthenticateAsServer(serverCertificate, false, DefaultProtocols(), false);
AuthenticateAsServer(serverCertificate, false, ServicePointManager.DefaultSslProtocols, false);
}
public virtual void AuthenticateAsServer(X509Certificate serverCertificate, bool clientCertificateRequired,
bool checkCertificateRevocation)
{
AuthenticateAsServer(serverCertificate, clientCertificateRequired, ServicePointManager.DefaultSslProtocols, checkCertificateRevocation);
}
//
public virtual void AuthenticateAsServer(X509Certificate serverCertificate, bool clientCertificateRequired,
SslProtocols enabledSslProtocols, bool checkCertificateRevocation)
@@ -196,10 +206,19 @@ using System.Net.Configuration;
{
return BeginAuthenticateAsServer(serverCertificate, false, DefaultProtocols(), false,
return BeginAuthenticateAsServer(serverCertificate, false, ServicePointManager.DefaultSslProtocols, false,
asyncCallback,
asyncState);
}
[HostProtection(ExternalThreading = true)]
public virtual IAsyncResult BeginAuthenticateAsServer(X509Certificate serverCertificate, bool clientCertificateRequired,
bool checkCertificateRevocation, AsyncCallback asyncCallback,
object asyncState)
{
return BeginAuthenticateAsServer(serverCertificate, clientCertificateRequired, ServicePointManager.DefaultSslProtocols, checkCertificateRevocation, asyncCallback, asyncState);
}
//
[HostProtection(ExternalThreading=true)]
public virtual IAsyncResult BeginAuthenticateAsServer(X509Certificate serverCertificate, bool clientCertificateRequired,
@@ -219,6 +238,16 @@ using System.Net.Configuration;
_SslState.EndProcessAuthentication(asyncResult);
}
internal virtual IAsyncResult BeginShutdown(AsyncCallback asyncCallback, object asyncState)
{
return _SslState.BeginShutdown(asyncCallback, asyncState);
}
internal virtual void EndShutdown(IAsyncResult asyncResult)
{
_SslState.EndShutdown(asyncResult);
}
public TransportContext TransportContext
{
get
@@ -243,6 +272,12 @@ using System.Net.Configuration;
return Task.Factory.FromAsync(BeginAuthenticateAsClient, EndAuthenticateAsClient, targetHost, null);
}
[HostProtection(ExternalThreading = true)]
public virtual Task AuthenticateAsClientAsync(string targetHost, X509CertificateCollection clientCertificates, bool checkCertificateRevocation)
{
return AuthenticateAsClientAsync(targetHost, clientCertificates, ServicePointManager.DefaultSslProtocols, checkCertificateRevocation);
}
[HostProtection(ExternalThreading = true)]
public virtual Task AuthenticateAsClientAsync(string targetHost, X509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, bool checkCertificateRevocation)
{
@@ -255,12 +290,26 @@ using System.Net.Configuration;
return Task.Factory.FromAsync(BeginAuthenticateAsServer, EndAuthenticateAsServer, serverCertificate, null);
}
[HostProtection(ExternalThreading = true)]
public virtual Task AuthenticateAsServerAsync(X509Certificate serverCertificate, bool clientCertificateRequired, bool checkCertificateRevocation)
{
return AuthenticateAsServerAsync(serverCertificate, clientCertificateRequired, ServicePointManager.DefaultSslProtocols, checkCertificateRevocation);
}
[HostProtection(ExternalThreading = true)]
public virtual Task AuthenticateAsServerAsync(X509Certificate serverCertificate, bool clientCertificateRequired, SslProtocols enabledSslProtocols, bool checkCertificateRevocation)
{
return Task.Factory.FromAsync((callback, state) => BeginAuthenticateAsServer(serverCertificate, clientCertificateRequired, enabledSslProtocols, checkCertificateRevocation, callback, state), EndAuthenticateAsServer, null);
}
[HostProtection(ExternalThreading = true)]
public virtual Task ShutdownAsync()
{
return Task.Factory.FromAsync(
(callback, state) => BeginShutdown(callback, state),
EndShutdown,
null);
}
//
//
@@ -393,7 +442,7 @@ using System.Net.Configuration;
//
public override bool CanWrite {
get {
return _SslState.IsAuthenticated && InnerStream.CanWrite;
return _SslState.IsAuthenticated && InnerStream.CanWrite && !_SslState.IsShutdown;
}
}
//

View File

@@ -8,7 +8,7 @@ Module Name:
Abstract:
The class is a simple wrapper on top of a read stream.
It will read the exact number of bytes requested.
It operates either [....] or async.
It operates either sync or async.
Author:
@@ -76,7 +76,7 @@ namespace System.Net {
StartReading();
}
//
// Loops while subsequest completions are [....]
// Loops while subsequest completions are sync
//
private void StartReading()
{

View File

@@ -117,7 +117,7 @@ namespace System.Net.Security {
throw new ArgumentOutOfRangeException("count", SR.GetString(SR.net_offset_plus_count));
}
//
// Combined [....]/async write method. For [....] requet asyncRequest==null
// Combined sync/async write method. For sync requet asyncRequest==null
//
private void ProcessWrite(byte[] buffer, int offset, int count, AsyncProtocolRequest asyncRequest)
{
@@ -198,9 +198,9 @@ namespace System.Net.Security {
}
}
//
// Combined [....]/async read method. For [....] requet asyncRequest==null
// There is a little overheader because we need to pass buffer/offset/count used only in [....].
// Still the benefit is that we have a common [....]/async code path.
// Combined sync/async read method. For sync requet asyncRequest==null
// There is a little overheader because we need to pass buffer/offset/count used only in sync.
// Still the benefit is that we have a common sync/async code path.
//
private int ProcessRead(byte[] buffer, int offset, int count, AsyncProtocolRequest asyncRequest)
{
@@ -240,7 +240,7 @@ namespace System.Net.Security {
}
finally
{
// if [....] request or exception
// if sync request or exception
if (asyncRequest == null || failed)
{
_NestedRead = 0;
@@ -330,7 +330,7 @@ namespace System.Net.Security {
}
readBytes = asyncRequest.Result;
}
else //[....]
else //Sync
{
readBytes = _FrameReader.ReadPacket(InternalBuffer, 0, readBytes);
}

View File

@@ -16,7 +16,7 @@ Author:
Revision History:
22-Aug-2003 Adopted for new Ssl feature design.
15-Sept-2003 Implemented concurent rehanshake
15-Sept-2003 Implemented concurrent rehanshake
--*/
#if MONO_FEATURE_NEW_TLS && SECURITY_DEP
@@ -59,6 +59,7 @@ namespace System.Net.Security {
private bool _HandshakeCompleted;
private bool _CertValidationFailed;
private bool _Shutdown;
private SecurityStatus _SecurityStatus;
private Exception _Exception;
@@ -71,7 +72,7 @@ namespace System.Net.Security {
}
private CachedSessionStatus _CachedSession;
// This block is used by rehandshake code to buffer data decryptred with the old key
// This block is used by rehandshake code to buffer data decrypted with the old key
private byte[] _QueuedReadData;
private int _QueuedReadCount;
private int _PendingReHandshake;
@@ -144,8 +145,8 @@ namespace System.Net.Security {
{
//
// We don;t support SSL alerts right now, hence any exception is fatal and cannot be retried
// Consider: make use if SSL alerts to re-[....] SslStream on both sides for retrying.
// We don't support SSL alerts right now, hence any exception is fatal and cannot be retried
// Consider: make use if SSL alerts to re-sync SslStream on both sides for retrying.
//
if (_Exception != null && !_CanRetryAuthentication) {
throw _Exception;
@@ -163,7 +164,6 @@ namespace System.Net.Security {
throw new ArgumentNullException("targetHost");
}
if (isServer ) {
enabledSslProtocols &= (SslProtocols)SchProtocols.ServerMask;
if (serverCertificate == null)
@@ -173,7 +173,7 @@ namespace System.Net.Security {
enabledSslProtocols &= (SslProtocols)SchProtocols.ClientMask;
}
if ((int)enabledSslProtocols == 0) {
if (ServicePointManager.DisableSystemDefaultTlsVersions && ((int)enabledSslProtocols == 0)) {
throw new ArgumentException(SR.GetString(SR.net_invalid_enum, "SslProtocolType"), "sslProtocolType");
}
@@ -281,6 +281,14 @@ namespace System.Net.Security {
}
}
//
internal bool IsShutdown
{
get
{
return _Shutdown;
}
}
//
internal bool DataAvailable {
get {
return IsAuthenticated && (SecureStream.DataAvailable || _QueuedReadCount != 0);
@@ -455,14 +463,19 @@ namespace System.Net.Security {
//
//
//
internal void CheckThrow(bool authSucessCheck) {
//
internal void CheckThrow(bool authSuccessCheck, bool shutdownCheck = false) {
if (_Exception != null) {
throw _Exception;
}
if (authSucessCheck && !IsAuthenticated) {
if (authSuccessCheck && !IsAuthenticated) {
throw new InvalidOperationException(SR.GetString(SR.net_auth_noauth));
}
if (shutdownCheck && _Shutdown && !LocalAppContextSwitches.DontEnableTlsAlerts) {
throw new InvalidOperationException(SR.net_ssl_io_already_shutdown);
}
}
//
internal void Flush()
@@ -648,7 +661,7 @@ namespace System.Net.Security {
// Async handshake is enqueued and will resume later
return;
}
// Either [....] handshake is ready to go or async handshake won the ---- over write.
// Either Sync handshake is ready to go or async handshake won the ---- over write.
// This will tell that we don't know the framing yet (what SSL version is)
_Framing = Framing.None;
@@ -807,11 +820,14 @@ namespace System.Net.Security {
}
else if (message.Done && _PendingReHandshake == 0)
{
if (!CompleteHandshake())
ProtocolToken alertToken = null;
if (!CompleteHandshake(ref alertToken))
{
StartSendAuthResetSignal(null, asyncRequest, new AuthenticationException(SR.GetString(SR.net_ssl_io_cert_validation), null));
StartSendAuthResetSignal(alertToken, asyncRequest, new AuthenticationException(SR.GetString(SR.net_ssl_io_cert_validation), null));
return;
}
// Release waiting IO if any. Presumably it should not throw.
// Otheriwse application may get not expected type of the exception.
FinishHandshake(null, asyncRequest);
@@ -992,11 +1008,11 @@ namespace System.Net.Security {
//
// - Returns false if failed to verify the Remote Cert
//
private bool CompleteHandshake() {
private bool CompleteHandshake(ref ProtocolToken alertToken) {
GlobalLog.Enter("CompleteHandshake");
Context.ProcessHandshakeSuccess();
if (!Context.VerifyRemoteCertificate(_CertValidationDelegate))
if (!Context.VerifyRemoteCertificate(_CertValidationDelegate, ref alertToken))
{
_HandshakeCompleted = false;
_CertValidationFailed = true;
@@ -1315,7 +1331,7 @@ namespace System.Net.Security {
_QueuedWriteStateRequest = null;
if (obj is LazyAsyncResult)
{
// [....] handshake is waiting on other thread.
// sync handshake is waiting on other thread.
((LazyAsyncResult)obj).InvokeCallback();
}
else
@@ -1326,6 +1342,23 @@ namespace System.Net.Security {
}
}
}
internal IAsyncResult BeginShutdown(AsyncCallback asyncCallback, object asyncState)
{
CheckThrow(authSuccessCheck: true, shutdownCheck: true);
ProtocolToken message = Context.CreateShutdownToken();
return InnerStream.BeginWrite(message.Payload, 0, message.Payload.Length, asyncCallback, asyncState);
}
internal void EndShutdown(IAsyncResult result)
{
CheckThrow(authSuccessCheck: true, shutdownCheck: true);
InnerStream.EndWrite(result);
_Shutdown = true;
}
// true - operation queued
// false - operation can proceed
private bool CheckEnqueueHandshake(byte[] buffer, AsyncProtocolRequest asyncRequest)
@@ -1391,7 +1424,7 @@ namespace System.Net.Security {
if (obj is LazyAsyncResult)
{
// [....] write is waiting on other thread.
// sync write is waiting on other thread.
((LazyAsyncResult)obj).InvokeCallback();
}
else
@@ -1750,7 +1783,7 @@ namespace System.Net.Security {
FinishHandshake(exception, null);
}
}
#if TRAVE
[System.Diagnostics.Conditional("TRAVE")]
internal void DebugMembers() {

View File

@@ -315,10 +315,12 @@ namespace System.Net.Security {
throw new ArgumentOutOfRangeException("count", SR.GetString(SR.net_offset_plus_count));
}
//
// Combined [....]/async write method. For [....] case asyncRequest==null
// Combined sync/async write method. For sync case asyncRequest==null
//
private void ProcessWrite(BufferOffsetSize[] buffers, SplitWriteAsyncProtocolRequest asyncRequest)
{
_SslState.CheckThrow(authSuccessCheck: true, shutdownCheck: true);
foreach (BufferOffsetSize buffer in buffers)
{
ValidateParameters(buffer.Buffer, buffer.Offset, buffer.Size);
@@ -357,7 +359,7 @@ namespace System.Net.Security {
}
}
//
// Combined [....]/async write method. For [....] case asyncRequest==null
// Combined sync/async write method. For sync case asyncRequest==null
//
private void ProcessWrite(byte[] buffer, int offset, int count, AsyncProtocolRequest asyncRequest)
{
@@ -376,6 +378,7 @@ namespace System.Net.Security {
}
ValidateParameters(buffer, offset, count);
_SslState.CheckThrow(authSuccessCheck: true, shutdownCheck: true);
if (Interlocked.Exchange(ref _NestedWrite, 1) == 1)
{
@@ -634,9 +637,9 @@ namespace System.Net.Security {
}
//
// Combined [....]/async read method. For [....] requet asyncRequest==null
// There is a little overheader because we need to pass buffer/offset/count used only in [....].
// Still the benefit is that we have a common [....]/async code path.
// Combined sync/async read method. For sync requet asyncRequest==null
// There is a little overheader because we need to pass buffer/offset/count used only in sync.
// Still the benefit is that we have a common sync/async code path.
//
private int ProcessRead(byte[] buffer, int offset, int count, AsyncProtocolRequest asyncRequest)
{
@@ -678,7 +681,7 @@ namespace System.Net.Security {
}
finally
{
// if [....] request or exception
// if sync request or exception
if (asyncRequest == null || failed)
{
_NestedRead = 0;
@@ -793,7 +796,7 @@ namespace System.Net.Security {
}
readBytes = asyncRequest.Result;
}
else //[....]
else //Sync
{
readBytes = _Reader.ReadPacket(InternalBuffer, SecureChannel.ReadHeaderSize, readBytes);
}

View File

@@ -253,7 +253,7 @@ namespace System.Net {
abortSocket6 = socket6;
//
// Setup socket timeouts for [....] requests
// Setup socket timeouts for sync requests
//
//

View File

@@ -3,195 +3,18 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
namespace System.Net {
using System.Collections;
using System.Collections.Generic;
using System.Configuration;
using System.IO;
using System.Net.Configuration;
using System.Net.Sockets;
using System.Net.Security;
using System.Security;
using System.Security.Permissions;
using System.Security.Cryptography.X509Certificates;
using System.Threading;
using System.Globalization;
using System.Runtime.CompilerServices;
using System.Diagnostics.CodeAnalysis;
using Microsoft.Win32;
// This turned to be a legacy type name that is simply forwarded to System.Security.Authentication.SslProtocols defined values.
#if !FEATURE_PAL || MONO
[Flags]
public enum SecurityProtocolType
{
Ssl3 = System.Security.Authentication.SslProtocols.Ssl3,
Tls = System.Security.Authentication.SslProtocols.Tls,
Tls11 = System.Security.Authentication.SslProtocols.Tls11,
Tls12 = System.Security.Authentication.SslProtocols.Tls12,
}
#endif
#if !MONO && !FEATURE_PAL
internal class CertPolicyValidationCallback
{
readonly ICertificatePolicy m_CertificatePolicy;
readonly ExecutionContext m_Context;
internal CertPolicyValidationCallback()
{
m_CertificatePolicy = new DefaultCertPolicy();
m_Context = null;
}
internal CertPolicyValidationCallback(ICertificatePolicy certificatePolicy)
{
m_CertificatePolicy = certificatePolicy;
m_Context = ExecutionContext.Capture();
}
internal ICertificatePolicy CertificatePolicy {
get { return m_CertificatePolicy;}
}
internal bool UsesDefault {
get { return m_Context == null;}
}
internal void Callback(object state)
{
CallbackContext context = (CallbackContext) state;
context.result = context.policyWrapper.CheckErrors(context.hostName,
context.certificate,
context.chain,
context.sslPolicyErrors);
}
internal bool Invoke(string hostName,
ServicePoint servicePoint,
X509Certificate certificate,
WebRequest request,
X509Chain chain,
SslPolicyErrors sslPolicyErrors)
{
PolicyWrapper policyWrapper = new PolicyWrapper(m_CertificatePolicy,
servicePoint,
(WebRequest) request);
if (m_Context == null)
{
return policyWrapper.CheckErrors(hostName,
certificate,
chain,
sslPolicyErrors);
}
else
{
ExecutionContext execContext = m_Context.CreateCopy();
CallbackContext callbackContext = new CallbackContext(policyWrapper,
hostName,
certificate,
chain,
sslPolicyErrors);
ExecutionContext.Run(execContext, Callback, callbackContext);
return callbackContext.result;
}
}
private class CallbackContext
{
internal CallbackContext(PolicyWrapper policyWrapper,
string hostName,
X509Certificate certificate,
X509Chain chain,
SslPolicyErrors sslPolicyErrors)
{
this.policyWrapper = policyWrapper;
this.hostName = hostName;
this.certificate = certificate;
this.chain = chain;
this.sslPolicyErrors = sslPolicyErrors;
}
internal readonly PolicyWrapper policyWrapper;
internal readonly string hostName;
internal readonly X509Certificate certificate;
internal readonly X509Chain chain;
internal readonly SslPolicyErrors sslPolicyErrors;
internal bool result;
}
}
#elif MONO || !FEATURE_PAL
internal class ServerCertValidationCallback
{
readonly RemoteCertificateValidationCallback m_ValidationCallback;
readonly ExecutionContext m_Context;
internal ServerCertValidationCallback(RemoteCertificateValidationCallback validationCallback)
{
m_ValidationCallback = validationCallback;
m_Context = ExecutionContext.Capture();
}
internal RemoteCertificateValidationCallback ValidationCallback {
get { return m_ValidationCallback;}
}
internal void Callback(object state)
{
CallbackContext context = (CallbackContext) state;
context.result = m_ValidationCallback(context.request,
context.certificate,
context.chain,
context.sslPolicyErrors);
}
internal bool Invoke(object request,
X509Certificate certificate,
X509Chain chain,
SslPolicyErrors sslPolicyErrors)
{
if (m_Context == null)
{
return m_ValidationCallback(request, certificate, chain, sslPolicyErrors);
}
else
{
ExecutionContext execContext = m_Context.CreateCopy();
CallbackContext callbackContext = new CallbackContext(request,
certificate,
chain,
sslPolicyErrors);
ExecutionContext.Run(execContext, Callback, callbackContext);
return callbackContext.result;
}
}
private class CallbackContext
{
internal readonly Object request;
internal readonly X509Certificate certificate;
internal readonly X509Chain chain;
internal readonly SslPolicyErrors sslPolicyErrors;
internal bool result;
internal CallbackContext(Object request,
X509Certificate certificate,
X509Chain chain,
SslPolicyErrors sslPolicyErrors)
{
this.request = request;
this.certificate = certificate;
this.chain = chain;
this.sslPolicyErrors = sslPolicyErrors;
}
}
}
#endif // !FEATURE_PAL
#if MONO_FEATURE_WEB_STACK
namespace System.Net {
using Diagnostics;
using System.Collections;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.Net.Configuration;
using System.Net.Security;
using System.Runtime.CompilerServices;
using System.Security.Authentication;
using System.Threading;
//
// The ServicePointManager class hands out ServicePoints (may exist or be created
// as needed) and makes sure they are garbage collected when they expire.
@@ -202,7 +25,7 @@ namespace System.Net {
/// <para>Manages the collection of <see cref='System.Net.ServicePoint'/> instances.</para>
/// </devdoc>
///
public class ServicePointManager {
public partial class ServicePointManager {
/// <devdoc>
/// <para>
@@ -247,24 +70,18 @@ namespace System.Net {
private static volatile CertPolicyValidationCallback s_CertPolicyValidationCallback = new CertPolicyValidationCallback();
private static volatile ServerCertValidationCallback s_ServerCertValidationCallback = null;
private const string sendAuxRecordValueName = "SchSendAuxRecord";
private const string sendAuxRecordAppSetting = "System.Net.ServicePointManager.SchSendAuxRecord";
private const string strongCryptoValueName = "SchUseStrongCrypto";
private const string secureProtocolAppSetting = "System.Net.ServicePointManager.SecurityProtocol";
private static SecurityProtocolType s_SecurityProtocolType;
private static object configurationLoadedLock = new object();
private static volatile bool configurationLoaded = false;
private static bool disableStrongCrypto = false;
private static bool disableSendAuxRecord = false;
private static bool s_reusePort;
private static bool? s_reusePortSupported = null;
private static SecurityProtocolType s_SecurityProtocolType = SecurityProtocolType.Tls | SecurityProtocolType.Ssl3;
private static bool s_disableStrongCrypto;
private static bool s_disableSendAuxRecord;
private static bool s_disableSystemDefaultTlsVersions;
private static SslProtocols s_defaultSslProtocols;
private const string reusePortValueName = "HWRPortReuseOnSocketBind";
private static object reusePortLock = new object();
private static volatile bool reusePortSettingsInitialized = false;
private static bool reusePort = false;
private static bool? reusePortSupported = null;
#endif // !FEATURE_PAL
private static volatile Hashtable s_ConfigTable = null;
private static volatile int s_ConnectionLimit = PersistentConnectionLimit;
@@ -442,10 +259,16 @@ namespace System.Net {
private static void ValidateSecurityProtocol(SecurityProtocolType value)
{
// Do not allow Ssl2 (and others) as explicit SSL version request
// Do not allow Ssl2 (and others) as explicit SSL version request.
SecurityProtocolType allowed = SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls
| SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12;
Debug.Assert((int)SecurityProtocolType.SystemDefault == (int)SslProtocols.None);
Debug.Assert((int)SecurityProtocolType.Ssl3 == (int)SslProtocols.Ssl3);
Debug.Assert((int)SecurityProtocolType.Tls == (int)SslProtocols.Tls);
Debug.Assert((int)SecurityProtocolType.Tls11 == (int)SslProtocols.Tls11);
Debug.Assert((int)SecurityProtocolType.Tls12 == (int)SslProtocols.Tls12);
if ((value & ~allowed) != 0)
{
throw new NotSupportedException(SR.GetString(SR.net_securityprotocolnotsupported));
@@ -453,6 +276,42 @@ namespace System.Net {
}
#endif // !FEATURE_PAL
internal static bool DisableStrongCrypto
{
get
{
EnsureConfigurationLoaded();
return s_disableStrongCrypto;
}
}
internal static bool DisableSystemDefaultTlsVersions
{
get
{
EnsureConfigurationLoaded();
return s_disableSystemDefaultTlsVersions;
}
}
internal static bool DisableSendAuxRecord
{
get
{
EnsureConfigurationLoaded();
return s_disableSendAuxRecord;
}
}
internal static SslProtocols DefaultSslProtocols
{
get
{
EnsureConfigurationLoaded();
return s_defaultSslProtocols;
}
}
//
// accessors
//
@@ -641,171 +500,24 @@ namespace System.Net {
}
}
internal static bool DisableStrongCrypto {
get {
EnsureConfigurationLoaded();
return disableStrongCrypto;
}
}
internal static bool DisableSendAuxRecord {
get {
EnsureConfigurationLoaded();
return disableSendAuxRecord;
}
}
private static void EnsureConfigurationLoaded() {
if (configurationLoaded) {
return;
}
lock (configurationLoadedLock) {
if (configurationLoaded) {
return;
}
LoadDisableStrongCryptoConfiguration();
LoadDisableSendAuxRecordConfiguration();
configurationLoaded = true;
}
}
private static void LoadDisableStrongCryptoConfiguration() {
try {
bool disableStrongCryptoInternal = false;
int schUseStrongCryptoKeyValue = 0;
if (LocalAppContextSwitches.DontEnableSchUseStrongCrypto) {
//.Net 4.5.2 and below will default to false unless the registry key is specifically set to 1.
schUseStrongCryptoKeyValue =
RegistryConfiguration.GlobalConfigReadInt(strongCryptoValueName, 0);
disableStrongCryptoInternal = schUseStrongCryptoKeyValue != 1;
}
else {
// .Net 4.6 and above will default to true unless the registry key is specifically set to 0.
schUseStrongCryptoKeyValue =
RegistryConfiguration.GlobalConfigReadInt(strongCryptoValueName, 1);
disableStrongCryptoInternal = schUseStrongCryptoKeyValue == 0;
}
if (disableStrongCryptoInternal) {
// Revert the SecurityProtocol selection to the legacy combination.
s_SecurityProtocolType = SecurityProtocolType.Tls | SecurityProtocolType.Ssl3;
}
else {
s_SecurityProtocolType =
SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;
string appSetting = RegistryConfiguration.AppConfigReadString(secureProtocolAppSetting, null);
SecurityProtocolType value;
try {
value = (SecurityProtocolType)Enum.Parse(typeof(SecurityProtocolType), appSetting);
ValidateSecurityProtocol(value);
s_SecurityProtocolType = value;
}
// Ignore all potential exceptions caused by Enum.Parse.
catch (ArgumentNullException) { }
catch (ArgumentException) { }
catch (NotSupportedException) { }
catch (OverflowException) { }
}
disableStrongCrypto = disableStrongCryptoInternal;
}
catch (Exception e)
{
if (e is ThreadAbortException || e is StackOverflowException || e is OutOfMemoryException)
{
throw;
}
}
}
private static void LoadDisableSendAuxRecordConfiguration() {
try {
if (LocalAppContextSwitches.DontEnableSchSendAuxRecord) {
disableSendAuxRecord = true;
return;
}
int schSendAuxRecordKeyValue = 1;
schSendAuxRecordKeyValue = RegistryConfiguration.AppConfigReadInt(sendAuxRecordAppSetting, 1);
if (schSendAuxRecordKeyValue == 0) {
disableSendAuxRecord = true;
return;
}
schSendAuxRecordKeyValue = RegistryConfiguration.GlobalConfigReadInt(sendAuxRecordValueName, 1);
if (schSendAuxRecordKeyValue == 0) {
disableSendAuxRecord = true;
return;
}
}
catch (Exception e)
{
if (e is ThreadAbortException || e is StackOverflowException || e is OutOfMemoryException)
{
throw;
}
}
}
public static bool ReusePort {
get {
EnsureReusePortSettingsInitialized();
return reusePort;
return s_reusePort;
}
set {
EnsureReusePortSettingsInitialized();
reusePort = value;
}
}
internal static bool? ReusePortSupported {
get {
return reusePortSupported;
}
set {
reusePortSupported = value;
s_reusePort = value;
}
}
private static void EnsureReusePortSettingsInitialized() {
if (reusePortSettingsInitialized) {
return;
internal static bool? ReusePortSupported
{
get
{
return s_reusePortSupported;
}
lock (reusePortLock) {
if (reusePortSettingsInitialized) {
return;
}
int reusePortKeyValue = 0;
try {
reusePortKeyValue = RegistryConfiguration.GlobalConfigReadInt(reusePortValueName, 0);
}
catch (Exception e) {
if (e is ThreadAbortException || e is StackOverflowException || e is OutOfMemoryException) {
throw;
}
}
bool reusePortInternal = false;
if (reusePortKeyValue == 1) {
if (Logging.On) {
Logging.PrintInfo(Logging.Web, typeof(ServicePointManager), SR.GetString(SR.net_log_set_socketoption_reuseport_default_on));
}
reusePortInternal = true;
}
reusePort = reusePortInternal;
reusePortSettingsInitialized = true;
set
{
s_reusePortSupported = value;
}
}
#endif // !FEATURE_PAL
@@ -1179,5 +891,6 @@ namespace System.Net {
GlobalLog.Leave("ServicePointManager::SetTcpKeepAlive()");
}
}
#endif
}
#endif

View File

@@ -483,7 +483,7 @@ namespace System.Net.Sockets {
#if DEBUG
using (GlobalLog.SetThreadKind(ThreadKinds.User | ThreadKinds.Sync)) {
#endif
bool canRead = CanRead; // Prevent race with Dispose.
bool canRead = CanRead; // Prevent ---- with Dispose.
if (m_CleanedUp){
throw new ObjectDisposedException(this.GetType().FullName);
}
@@ -557,7 +557,7 @@ namespace System.Net.Sockets {
#if DEBUG
using (GlobalLog.SetThreadKind(ThreadKinds.User | ThreadKinds.Sync)) {
#endif
bool canWrite = CanWrite; // Prevent race with Dispose.
bool canWrite = CanWrite; // Prevent ---- with Dispose.
if (m_CleanedUp){
throw new ObjectDisposedException(this.GetType().FullName);
}
@@ -717,7 +717,7 @@ namespace System.Net.Sockets {
#if DEBUG
using (GlobalLog.SetThreadKind(ThreadKinds.User | ThreadKinds.Async)) {
#endif
bool canRead = CanRead; // Prevent race with Dispose.
bool canRead = CanRead; // Prevent ---- with Dispose.
if (m_CleanedUp){
throw new ObjectDisposedException(this.GetType().FullName);
}
@@ -772,7 +772,7 @@ namespace System.Net.Sockets {
internal virtual IAsyncResult UnsafeBeginRead(byte[] buffer, int offset, int size, AsyncCallback callback, Object state)
{
bool canRead = CanRead; // Prevent race with Dispose.
bool canRead = CanRead; // Prevent ---- with Dispose.
if (m_CleanedUp)
{
throw new ObjectDisposedException(GetType().FullName);
@@ -902,7 +902,7 @@ namespace System.Net.Sockets {
#if DEBUG
using (GlobalLog.SetThreadKind(ThreadKinds.User | ThreadKinds.Async)) {
#endif
bool canWrite = CanWrite; // Prevent race with Dispose.
bool canWrite = CanWrite; // Prevent ---- with Dispose.
if (m_CleanedUp){
throw new ObjectDisposedException(this.GetType().FullName);
}
@@ -964,7 +964,7 @@ namespace System.Net.Sockets {
#if DEBUG
using (GlobalLog.SetThreadKind(ThreadKinds.User | ThreadKinds.Async)) {
#endif
bool canWrite = CanWrite; // Prevent race with Dispose.
bool canWrite = CanWrite; // Prevent ---- with Dispose.
if (m_CleanedUp){
throw new ObjectDisposedException(this.GetType().FullName);
}
@@ -1061,7 +1061,7 @@ namespace System.Net.Sockets {
/// <devdoc>
/// <para>
/// Performs a [....] Write of an array of buffers.
/// Performs a sync Write of an array of buffers.
/// </para>
/// </devdoc>
internal virtual void MultipleWrite(BufferOffsetSize[] buffers)

Some files were not shown because too many files have changed in this diff Show More