Imported Upstream version 5.10.0.69

Former-commit-id: fc39669a0b707dd3c063977486506b6793da2890
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2018-01-29 19:03:06 +00:00
parent d8f8abd549
commit e2950ec768
6283 changed files with 453847 additions and 91879 deletions

View File

@@ -140,4 +140,4 @@
<Reference Include="System.Threading.Thread" />
</ItemGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
</Project>
</Project>

View File

@@ -11,13 +11,6 @@ using System.Text;
namespace System.Net
{
internal enum FtpPrimitive
{
Upload = 0,
Download = 1,
CommandOnly = 2
};
internal enum FtpLoginState : byte
{
NotLoggedIn,
@@ -381,7 +374,7 @@ namespace System.Net
// OR set us up for SSL/TLS, after this we'll be writing securely
else if (status == FtpStatusCode.ServerWantsSecureSession)
{
// If NetworkStream is a TlsStream, then this must be in the async callback
// If NetworkStream is a TlsStream, then this must be in the async callback
// from completing the SSL handshake.
// So just let the pipeline continue.
if (!(NetworkStream is TlsStream))
@@ -743,14 +736,6 @@ namespace System.Net
return result;
}
//
// A door into protected CloseSocket() method
//
internal void Quit()
{
CloseSocket();
}
private enum GetPathOption
{
Normal,

View File

@@ -87,11 +87,6 @@ namespace System.Net
get { return (Flags & FtpMethodFlags.IsDownload) != 0; }
}
internal bool HasHttpCommand
{
get { return (Flags & FtpMethodFlags.HasHttpCommand) != 0; }
}
/// <summary>
/// <para>True if we should attempt to get a response uri
/// out of a server response</para>
@@ -241,15 +236,6 @@ namespace System.Net
}
}
// Used by FtpControlStream
internal static NetworkCredential DefaultNetworkCredential
{
get
{
return s_defaultFtpNetworkCredential;
}
}
public static new RequestCachePolicy DefaultCachePolicy
{
get
@@ -1503,9 +1489,9 @@ namespace System.Net
if (stage >= RequestStage.WriteReady)
{
// If writeResult == null and this is an upload request, it means
// that the user has called GetResponse() without calling
// GetRequestStream() first. So they are not interested in a
// stream. Therefore we close the stream so that the
// that the user has called GetResponse() without calling
// GetRequestStream() first. So they are not interested in a
// stream. Therefore we close the stream so that the
// request/pipeline can continue
if (_methodInfo.IsUpload && !_getRequestStreamStarted)
{
@@ -1807,28 +1793,6 @@ namespace System.Net
return;
}
/// <summary>
/// <para>Returns username string</para>
/// </summary>
internal string GetUserString()
{
string name = null;
if (this.Credentials != null)
{
NetworkCredential networkCreds = this.Credentials.GetCredential(_uri, "basic");
if (networkCreds != null)
{
name = networkCreds.UserName;
string domain = networkCreds.Domain;
if (!string.IsNullOrEmpty(domain))
{
name = domain + "\\" + name;
}
}
}
return name == null ? null : (String.Compare(name, "anonymous", StringComparison.InvariantCultureIgnoreCase) == 0 ? null : name);
}
internal void DataStreamClosed(CloseExState closeState)
{
if ((closeState & CloseExState.Abort) == 0)

View File

@@ -98,11 +98,6 @@ namespace System.Net
}
}
internal void SetContentLength(long value)
{
_contentLength = value;
}
public override WebHeaderCollection Headers
{
get

View File

@@ -253,7 +253,7 @@ namespace System.Net
}
if (value < 0)
{
throw new ArgumentOutOfRangeException(nameof(value), SR.net_io_timeout_use_ge_zero);
throw new ArgumentOutOfRangeException(nameof(value), SR.net_clsmall);
}
SetSpecialHeaders(HttpKnownHeaderNames.ContentLength, value.ToString());
}

View File

@@ -13,6 +13,9 @@ namespace System.Net
/// </para>
/// </devdoc>
[Serializable]
#if !MONO
[System.Runtime.CompilerServices.TypeForwardedFrom("System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")]
#endif
public class ProtocolViolationException : InvalidOperationException, ISerializable
{
/// <devdoc>
@@ -37,7 +40,6 @@ namespace System.Net
protected ProtocolViolationException(SerializationInfo serializationInfo, StreamingContext streamingContext)
: base(serializationInfo, streamingContext)
{
throw new PlatformNotSupportedException();
}
void ISerializable.GetObjectData(SerializationInfo serializationInfo, StreamingContext streamingContext)

View File

@@ -31,11 +31,6 @@ namespace System.Net
/// </summary>
internal int Duration => _durationMilliseconds;
/// <summary>
/// <para>Creates and returns a handle to a new polled timer.</para>
/// </summary>
internal Timer CreateTimer() => CreateTimer(null, null);
/// <summary>
/// <para>Creates and returns a handle to a new timer with attached context.</para>
/// </summary>
@@ -56,11 +51,6 @@ namespace System.Net
_startTimeMilliseconds = Environment.TickCount;
}
/// <summary>
/// <para>The duration in milliseconds of timer.</para>
/// </summary>
internal int Duration => _durationMilliseconds;
/// <summary>
/// <para>The time (relative to Environment.TickCount) when the timer started.</para>
/// </summary>
@@ -71,31 +61,6 @@ namespace System.Net
/// </summary>
internal int Expiration => unchecked(_startTimeMilliseconds + _durationMilliseconds);
/// <summary>
/// <para>The amount of time left on the timer. 0 means it has fired. 1 means it has expired but
/// not yet fired. -1 means infinite. Int32.MaxValue is the ceiling - the actual value could be longer.</para>
/// </summary>
internal int TimeRemaining
{
get
{
if (HasExpired)
{
return 0;
}
if (Duration == Timeout.Infinite)
{
return Timeout.Infinite;
}
int now = Environment.TickCount;
int remaining = IsTickBetween(StartTime, Expiration, now) ?
(int)(Math.Min((uint)unchecked(Expiration - now), (uint)Int32.MaxValue)) : 0;
return remaining < 2 ? remaining + 1 : remaining;
}
}
/// <summary>
/// <para>Cancels the timer. Returns true if the timer hasn't and won't fire; false if it has or will.</para>
/// </summary>
@@ -610,7 +575,7 @@ namespace System.Net
if (NetEventSource.IsEnabled) NetEventSource.Info(null, $"Awoke, cause {(waitResult == WaitHandle.WaitTimeout ? "Timeout" : "Prod")}");
// If we timed out with nothing to do, shut down.
// If we timed out with nothing to do, shut down.
if (waitResult == WaitHandle.WaitTimeout && !haveNextTick)
{
Interlocked.CompareExchange(ref s_threadState, (int)TimerThreadState.Idle, (int)TimerThreadState.Running);

View File

@@ -10,6 +10,9 @@ using System.Threading.Tasks;
namespace System.Net
{
[Serializable]
#if !MONO
[System.Runtime.CompilerServices.TypeForwardedFrom("System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")]
#endif
public partial class WebException : InvalidOperationException, ISerializable
{
private const WebExceptionStatus DefaultStatus = WebExceptionStatus.UnknownError;
@@ -51,9 +54,9 @@ namespace System.Net
}
}
protected WebException(SerializationInfo serializationInfo, StreamingContext streamingContext) : base(serializationInfo, streamingContext)
protected WebException(SerializationInfo serializationInfo, StreamingContext streamingContext)
: base(serializationInfo, streamingContext)
{
throw new PlatformNotSupportedException();
}
public WebExceptionStatus Status