From 6c809510106a186a7895f0cc11f05589415b4240 Mon Sep 17 00:00:00 2001 From: wfurt Date: Wed, 27 Apr 2022 14:22:24 -0700 Subject: [PATCH 1/4] regenerate networking ref assemblies --- .../System.Net.Http/ref/System.Net.Http.cs | 163 ++++++++---------- .../ref/System.Net.Security.cs | 53 +++--- .../ref/System.Net.Sockets.cs | 63 +++---- 3 files changed, 133 insertions(+), 146 deletions(-) diff --git a/src/libraries/System.Net.Http/ref/System.Net.Http.cs b/src/libraries/System.Net.Http/ref/System.Net.Http.cs index b98f4ff8abc968..5c10452325c38e 100644 --- a/src/libraries/System.Net.Http/ref/System.Net.Http.cs +++ b/src/libraries/System.Net.Http/ref/System.Net.Http.cs @@ -4,9 +4,6 @@ // Changes to this file must follow the https://aka.ms/api-review process. // ------------------------------------------------------------------------------ -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; - namespace System.Net.Http { public partial class ByteArrayContent : System.Net.Http.HttpContent @@ -37,12 +34,7 @@ protected override void Dispose(bool disposing) { } } public partial class FormUrlEncodedContent : System.Net.Http.ByteArrayContent { - public FormUrlEncodedContent( - System.Collections.Generic.IEnumerable> nameValueCollection) : base (default(byte[])) { } + public FormUrlEncodedContent(System.Collections.Generic.IEnumerable> nameValueCollection) : base (default(byte[])) { } protected override System.Threading.Tasks.Task SerializeToStreamAsync(System.IO.Stream stream, System.Net.TransportContext? context, System.Threading.CancellationToken cancellationToken) { throw null; } } public delegate System.Text.Encoding? HeaderEncodingSelector(string headerName, TContext context); @@ -139,6 +131,8 @@ public HttpClientHandler() { } public bool PreAuthenticate { get { throw null; } set { } } public System.Collections.Generic.IDictionary Properties { get { throw null; } } [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("ios")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("tvos")] public System.Net.IWebProxy? Proxy { get { throw null; } set { } } [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] public System.Func? ServerCertificateCustomValidationCallback { get { throw null; } set { } } @@ -154,14 +148,7 @@ public HttpClientHandler() { } [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] public bool UseProxy { get { throw null; } set { } } protected override void Dispose(bool disposing) { } - // - // Attributes are commented out due to https://github.com/dotnet/arcade/issues/7585 - // API compat will fail until this is fixed - // - //[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("android")] [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] - //[System.Runtime.Versioning.UnsupportedOSPlatformAttributeUnsupportedOSPlatform("ios")] - //[System.Runtime.Versioning.UnsupportedOSPlatformAttributeUnsupportedOSPlatform("tvos")] protected internal override System.Net.Http.HttpResponseMessage Send(System.Net.Http.HttpRequestMessage request, System.Threading.CancellationToken cancellationToken) { throw null; } protected internal override System.Threading.Tasks.Task SendAsync(System.Net.Http.HttpRequestMessage request, System.Threading.CancellationToken cancellationToken) { throw null; } } @@ -199,6 +186,11 @@ protected virtual void SerializeToStream(System.IO.Stream stream, System.Net.Tra protected virtual System.Threading.Tasks.Task SerializeToStreamAsync(System.IO.Stream stream, System.Net.TransportContext? context, System.Threading.CancellationToken cancellationToken) { throw null; } protected internal abstract bool TryComputeLength(out long length); } + public enum HttpKeepAlivePingPolicy + { + WithActiveRequests = 0, + Always = 1, + } public abstract partial class HttpMessageHandler : System.IDisposable { protected HttpMessageHandler() { } @@ -229,8 +221,8 @@ public HttpMethod(string method) { } public static System.Net.Http.HttpMethod Post { get { throw null; } } public static System.Net.Http.HttpMethod Put { get { throw null; } } public static System.Net.Http.HttpMethod Trace { get { throw null; } } - public bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhen(true)] System.Net.Http.HttpMethod? other) { throw null; } - public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhen(true)] object? obj) { throw null; } + public bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] System.Net.Http.HttpMethod? other) { throw null; } + public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; } public override int GetHashCode() { throw null; } public static bool operator ==(System.Net.Http.HttpMethod? left, System.Net.Http.HttpMethod? right) { throw null; } public static bool operator !=(System.Net.Http.HttpMethod? left, System.Net.Http.HttpMethod? right) { throw null; } @@ -252,9 +244,9 @@ public HttpRequestMessage(System.Net.Http.HttpMethod method, System.Uri? request public System.Net.Http.HttpContent? Content { get { throw null; } set { } } public System.Net.Http.Headers.HttpRequestHeaders Headers { get { throw null; } } public System.Net.Http.HttpMethod Method { get { throw null; } set { } } + public System.Net.Http.HttpRequestOptions Options { get { throw null; } } [System.ObsoleteAttribute("HttpRequestMessage.Properties has been deprecated. Use Options instead.")] public System.Collections.Generic.IDictionary Properties { get { throw null; } } - public HttpRequestOptions Options { get { throw null; } } public System.Uri? RequestUri { get { throw null; } set { } } public System.Version Version { get { throw null; } set { } } public System.Net.Http.HttpVersionPolicy VersionPolicy { get { throw null; } set { } } @@ -262,35 +254,35 @@ public void Dispose() { } protected virtual void Dispose(bool disposing) { } public override string ToString() { throw null; } } - - public readonly struct HttpRequestOptionsKey + public sealed partial class HttpRequestOptions : System.Collections.Generic.ICollection>, System.Collections.Generic.IDictionary, System.Collections.Generic.IEnumerable>, System.Collections.IEnumerable { - public HttpRequestOptionsKey(string key) {} - public string Key { get { throw null; } } - } - - public sealed class HttpRequestOptions : System.Collections.Generic.IDictionary - { - void System.Collections.Generic.IDictionary.Add(string key, object? value) { throw null; } + public HttpRequestOptions() { } + int System.Collections.Generic.ICollection>.Count { get { throw null; } } + bool System.Collections.Generic.ICollection>.IsReadOnly { get { throw null; } } + object? System.Collections.Generic.IDictionary.this[string key] { get { throw null; } set { } } System.Collections.Generic.ICollection System.Collections.Generic.IDictionary.Keys { get { throw null; } } System.Collections.Generic.ICollection System.Collections.Generic.IDictionary.Values { get { throw null; } } - bool System.Collections.Generic.IDictionary.Remove(string key) { throw null; } - bool System.Collections.Generic.ICollection>.Remove(System.Collections.Generic.KeyValuePair item) { throw null; } - bool System.Collections.Generic.IDictionary.TryGetValue(string key, out object? value) { throw null; } - object? System.Collections.Generic.IDictionary.this[string key] { get { throw null; } set { } } - void System.Collections.Generic.ICollection>.Add(System.Collections.Generic.KeyValuePair item) { throw null; } - void System.Collections.Generic.ICollection>.Clear() { throw null; } - bool System.Collections.Generic.ICollection>.Contains(System.Collections.Generic.KeyValuePair item) { throw null; } + public void Set(System.Net.Http.HttpRequestOptionsKey key, TValue value) { } + void System.Collections.Generic.ICollection>.Add(System.Collections.Generic.KeyValuePair item) { } + void System.Collections.Generic.ICollection>.Clear() { } + bool System.Collections.Generic.ICollection>.Contains(System.Collections.Generic.KeyValuePair item) { throw null; } + void System.Collections.Generic.ICollection>.CopyTo(System.Collections.Generic.KeyValuePair[] array, int arrayIndex) { } + bool System.Collections.Generic.ICollection>.Remove(System.Collections.Generic.KeyValuePair item) { throw null; } + void System.Collections.Generic.IDictionary.Add(string key, object value) { } bool System.Collections.Generic.IDictionary.ContainsKey(string key) { throw null; } - void System.Collections.Generic.ICollection>.CopyTo(System.Collections.Generic.KeyValuePair[] array, int arrayIndex) { throw null; } - int System.Collections.Generic.ICollection>.Count { get { throw null; } } - bool System.Collections.Generic.ICollection>.IsReadOnly { get { throw null; } } - System.Collections.Generic.IEnumerator> System.Collections.Generic.IEnumerable>.GetEnumerator() { throw null; } + bool System.Collections.Generic.IDictionary.Remove(string key) { throw null; } + bool System.Collections.Generic.IDictionary.TryGetValue(string key, out object value) { throw null; } + System.Collections.Generic.IEnumerator> System.Collections.Generic.IEnumerable>.GetEnumerator() { throw null; } System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } - public bool TryGetValue(HttpRequestOptionsKey key, [MaybeNullWhen(false)] out TValue value) { throw null; } - public void Set(HttpRequestOptionsKey key, TValue value) { throw null; } + public bool TryGetValue(System.Net.Http.HttpRequestOptionsKey key, [System.Diagnostics.CodeAnalysis.MaybeNullWhenAttribute(false)] out TValue value) { throw null; } + } + public readonly partial struct HttpRequestOptionsKey + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public HttpRequestOptionsKey(string key) { throw null; } + public string Key { get { throw null; } } } - public partial class HttpResponseMessage : System.IDisposable { public HttpResponseMessage() { } @@ -361,28 +353,39 @@ protected override void SerializeToStream(System.IO.Stream stream, System.Net.Tr protected override System.Threading.Tasks.Task SerializeToStreamAsync(System.IO.Stream stream, System.Net.TransportContext? context, System.Threading.CancellationToken cancellationToken) { throw null; } protected internal override bool TryComputeLength(out long length) { throw null; } } + public sealed partial class SocketsHttpConnectionContext + { + internal SocketsHttpConnectionContext() { } + public System.Net.DnsEndPoint DnsEndPoint { get { throw null; } } + public System.Net.Http.HttpRequestMessage InitialRequestMessage { get { throw null; } } + } [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] public sealed partial class SocketsHttpHandler : System.Net.Http.HttpMessageHandler { public SocketsHttpHandler() { } - public int InitialHttp2StreamWindowSize { get { throw null; } set { } } - [System.Runtime.Versioning.UnsupportedOSPlatformGuardAttribute("browser")] - public static bool IsSupported { get { throw null; } } + [System.CLSCompliantAttribute(false)] + public System.Diagnostics.DistributedContextPropagator? ActivityHeadersPropagator { get { throw null; } set { } } public bool AllowAutoRedirect { get { throw null; } set { } } public System.Net.DecompressionMethods AutomaticDecompression { get { throw null; } set { } } + public System.Func>? ConnectCallback { get { throw null; } set { } } public System.TimeSpan ConnectTimeout { get { throw null; } set { } } [System.Diagnostics.CodeAnalysis.AllowNullAttribute] 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 bool EnableMultipleHttp2Connections { get { throw null; } set { } } public System.TimeSpan Expect100ContinueTimeout { get { throw null; } set { } } + public int InitialHttp2StreamWindowSize { get { throw null; } set { } } + [System.Runtime.Versioning.UnsupportedOSPlatformGuardAttribute("browser")] + public static bool IsSupported { get { throw null; } } public System.TimeSpan KeepAlivePingDelay { get { throw null; } set { } } + public System.Net.Http.HttpKeepAlivePingPolicy KeepAlivePingPolicy { get { throw null; } set { } } public System.TimeSpan KeepAlivePingTimeout { get { throw null; } set { } } - public HttpKeepAlivePingPolicy KeepAlivePingPolicy { get { throw null; } set { } } public int MaxAutomaticRedirections { get { throw null; } set { } } public int MaxConnectionsPerServer { get { throw null; } set { } } public int MaxResponseDrainSize { get { throw null; } set { } } public int MaxResponseHeadersLength { get { throw null; } set { } } + public System.Func>? PlaintextStreamFilter { get { throw null; } set { } } public System.TimeSpan PooledConnectionIdleTimeout { get { throw null; } set { } } public System.TimeSpan PooledConnectionLifetime { get { throw null; } set { } } public bool PreAuthenticate { get { throw null; } set { } } @@ -398,29 +401,13 @@ public SocketsHttpHandler() { } protected override void Dispose(bool disposing) { } protected internal override System.Net.Http.HttpResponseMessage Send(System.Net.Http.HttpRequestMessage request, System.Threading.CancellationToken cancellationToken) { throw null; } protected internal override System.Threading.Tasks.Task SendAsync(System.Net.Http.HttpRequestMessage request, System.Threading.CancellationToken cancellationToken) { throw null; } - public bool EnableMultipleHttp2Connections { get { throw null; } set { } } - public Func>? ConnectCallback { get { throw null; } set { } } - public Func>? PlaintextStreamFilter { get { throw null; } set { } } - [System.CLSCompliantAttribute(false)] - public System.Diagnostics.DistributedContextPropagator? ActivityHeadersPropagator { get { throw null; } set { } } } - public sealed class SocketsHttpConnectionContext - { - internal SocketsHttpConnectionContext() { } - public DnsEndPoint DnsEndPoint { get { throw null; } } - public HttpRequestMessage InitialRequestMessage { get { throw null; } } - } - public sealed class SocketsHttpPlaintextStreamFilterContext + public sealed partial class SocketsHttpPlaintextStreamFilterContext { internal SocketsHttpPlaintextStreamFilterContext() { } + public System.Net.Http.HttpRequestMessage InitialRequestMessage { get { throw null; } } + public System.Version NegotiatedHttpVersion { get { throw null; } } public System.IO.Stream PlaintextStream { get { throw null; } } - public Version NegotiatedHttpVersion { get { throw null; } } - public HttpRequestMessage InitialRequestMessage { get { throw null; } } - } - public enum HttpKeepAlivePingPolicy - { - WithActiveRequests, - Always } public partial class StreamContent : System.Net.Http.HttpContent { @@ -452,7 +439,7 @@ public AuthenticationHeaderValue(string scheme) { } public AuthenticationHeaderValue(string scheme, string? parameter) { } public string? Parameter { get { throw null; } } public string Scheme { get { throw null; } } - public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhen(true)] object? obj) { throw null; } + public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; } public override int GetHashCode() { throw null; } public static System.Net.Http.Headers.AuthenticationHeaderValue Parse(string? input) { throw null; } object System.ICloneable.Clone() { throw null; } @@ -478,7 +465,7 @@ public CacheControlHeaderValue() { } public bool ProxyRevalidate { get { throw null; } set { } } public bool Public { get { throw null; } set { } } public System.TimeSpan? SharedMaxAge { get { throw null; } set { } } - public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhen(true)] object? obj) { throw null; } + public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; } public override int GetHashCode() { throw null; } public static System.Net.Http.Headers.CacheControlHeaderValue Parse(string? input) { throw null; } object System.ICloneable.Clone() { throw null; } @@ -498,10 +485,10 @@ public ContentDispositionHeaderValue(string dispositionType) { } public System.Collections.Generic.ICollection Parameters { get { throw null; } } public System.DateTimeOffset? ReadDate { get { throw null; } set { } } public long? Size { get { throw null; } set { } } - public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhen(true)] object? obj) { throw null; } + public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; } public override int GetHashCode() { throw null; } public static System.Net.Http.Headers.ContentDispositionHeaderValue Parse(string? input) { throw null; } - object System.ICloneable.Clone() { throw null; } + object? System.ICloneable.Clone() { throw null; } public override string ToString() { throw null; } public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? input, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] out System.Net.Http.Headers.ContentDispositionHeaderValue? parsedValue) { throw null; } } @@ -516,7 +503,7 @@ public ContentRangeHeaderValue(long from, long to, long length) { } public long? Length { get { throw null; } } public long? To { get { throw null; } } public string Unit { get { throw null; } set { } } - public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhen(true)] object? obj) { throw null; } + public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; } public override int GetHashCode() { throw null; } public static System.Net.Http.Headers.ContentRangeHeaderValue Parse(string? input) { throw null; } object System.ICloneable.Clone() { throw null; } @@ -530,7 +517,7 @@ public EntityTagHeaderValue(string tag, bool isWeak) { } public static System.Net.Http.Headers.EntityTagHeaderValue Any { get { throw null; } } public bool IsWeak { get { throw null; } } public string Tag { get { throw null; } } - public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhen(true)] object? obj) { throw null; } + public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; } public override int GetHashCode() { throw null; } public static System.Net.Http.Headers.EntityTagHeaderValue Parse(string? input) { throw null; } object System.ICloneable.Clone() { throw null; } @@ -598,12 +585,12 @@ public void Clear() { } System.Collections.Generic.IEnumerable System.Collections.Generic.IReadOnlyDictionary.Keys { get { throw null; } } System.Collections.Generic.IEnumerable System.Collections.Generic.IReadOnlyDictionary.Values { get { throw null; } } public bool Contains(string headerName) { throw null; } - bool System.Collections.Generic.IReadOnlyDictionary.ContainsKey(string key) { throw null; } public System.Net.Http.Headers.HttpHeadersNonValidated.Enumerator GetEnumerator() { throw null; } System.Collections.Generic.IEnumerator> System.Collections.Generic.IEnumerable>.GetEnumerator() { throw null; } + bool System.Collections.Generic.IReadOnlyDictionary.ContainsKey(string key) { throw null; } + bool System.Collections.Generic.IReadOnlyDictionary.TryGetValue(string key, out System.Net.Http.Headers.HeaderStringValues value) { throw null; } System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } public bool TryGetValues(string headerName, out System.Net.Http.Headers.HeaderStringValues values) { throw null; } - bool System.Collections.Generic.IReadOnlyDictionary.TryGetValue(string key, out System.Net.Http.Headers.HeaderStringValues value) { throw null; } public partial struct Enumerator : System.Collections.Generic.IEnumerator>, System.Collections.IEnumerator, System.IDisposable { private object _dummy; @@ -699,10 +686,10 @@ public MediaTypeHeaderValue(string mediaType, string? charSet) { } [System.Diagnostics.CodeAnalysis.DisallowNullAttribute] public string? MediaType { get { throw null; } set { } } public System.Collections.Generic.ICollection Parameters { get { throw null; } } - public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhen(true)] object? obj) { throw null; } + public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; } public override int GetHashCode() { throw null; } public static System.Net.Http.Headers.MediaTypeHeaderValue Parse(string? input) { throw null; } - object System.ICloneable.Clone() { throw null; } + object? System.ICloneable.Clone() { throw null; } public override string ToString() { throw null; } public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? input, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] out System.Net.Http.Headers.MediaTypeHeaderValue? parsedValue) { throw null; } } @@ -717,12 +704,12 @@ public MediaTypeWithQualityHeaderValue(string mediaType, double quality) : base } public partial class NameValueHeaderValue : System.ICloneable { - protected NameValueHeaderValue(System.Net.Http.Headers.NameValueHeaderValue source) { } + protected internal NameValueHeaderValue(System.Net.Http.Headers.NameValueHeaderValue source) { } public NameValueHeaderValue(string name) { } public NameValueHeaderValue(string name, string? value) { } public string Name { get { throw null; } } public string? Value { get { throw null; } set { } } - public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhen(true)] object? obj) { throw null; } + public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; } public override int GetHashCode() { throw null; } public static System.Net.Http.Headers.NameValueHeaderValue Parse(string? input) { throw null; } object System.ICloneable.Clone() { throw null; } @@ -735,7 +722,7 @@ protected NameValueWithParametersHeaderValue(System.Net.Http.Headers.NameValueWi public NameValueWithParametersHeaderValue(string name) : base (default(string)) { } public NameValueWithParametersHeaderValue(string name, string? value) : base (default(string)) { } public System.Collections.Generic.ICollection Parameters { get { throw null; } } - public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhen(true)] object? obj) { throw null; } + public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; } public override int GetHashCode() { throw null; } public static new System.Net.Http.Headers.NameValueWithParametersHeaderValue Parse(string? input) { throw null; } object System.ICloneable.Clone() { throw null; } @@ -748,7 +735,7 @@ public ProductHeaderValue(string name) { } public ProductHeaderValue(string name, string? version) { } public string Name { get { throw null; } } public string? Version { get { throw null; } } - public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhen(true)] object? obj) { throw null; } + public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; } public override int GetHashCode() { throw null; } public static System.Net.Http.Headers.ProductHeaderValue Parse(string? input) { throw null; } object System.ICloneable.Clone() { throw null; } @@ -762,7 +749,7 @@ public ProductInfoHeaderValue(string comment) { } public ProductInfoHeaderValue(string productName, string? productVersion) { } public string? Comment { get { throw null; } } public System.Net.Http.Headers.ProductHeaderValue? Product { get { throw null; } } - public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhen(true)] object? obj) { throw null; } + public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; } public override int GetHashCode() { throw null; } public static System.Net.Http.Headers.ProductInfoHeaderValue Parse(string input) { throw null; } object System.ICloneable.Clone() { throw null; } @@ -776,7 +763,7 @@ public RangeConditionHeaderValue(System.Net.Http.Headers.EntityTagHeaderValue en public RangeConditionHeaderValue(string entityTag) { } public System.DateTimeOffset? Date { get { throw null; } } public System.Net.Http.Headers.EntityTagHeaderValue? EntityTag { get { throw null; } } - public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhen(true)] object? obj) { throw null; } + public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; } public override int GetHashCode() { throw null; } public static System.Net.Http.Headers.RangeConditionHeaderValue Parse(string? input) { throw null; } object System.ICloneable.Clone() { throw null; } @@ -789,7 +776,7 @@ public RangeHeaderValue() { } public RangeHeaderValue(long? from, long? to) { } public System.Collections.Generic.ICollection Ranges { get { throw null; } } public string Unit { get { throw null; } set { } } - public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhen(true)] object? obj) { throw null; } + public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; } public override int GetHashCode() { throw null; } public static System.Net.Http.Headers.RangeHeaderValue Parse(string? input) { throw null; } object System.ICloneable.Clone() { throw null; } @@ -801,7 +788,7 @@ public partial class RangeItemHeaderValue : System.ICloneable public RangeItemHeaderValue(long? from, long? to) { } public long? From { get { throw null; } } public long? To { get { throw null; } } - public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhen(true)] object? obj) { throw null; } + public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; } public override int GetHashCode() { throw null; } object System.ICloneable.Clone() { throw null; } public override string ToString() { throw null; } @@ -812,7 +799,7 @@ public RetryConditionHeaderValue(System.DateTimeOffset date) { } public RetryConditionHeaderValue(System.TimeSpan delta) { } public System.DateTimeOffset? Date { get { throw null; } } public System.TimeSpan? Delta { get { throw null; } } - public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhen(true)] object? obj) { throw null; } + public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; } public override int GetHashCode() { throw null; } public static System.Net.Http.Headers.RetryConditionHeaderValue Parse(string? input) { throw null; } object System.ICloneable.Clone() { throw null; } @@ -825,7 +812,7 @@ public StringWithQualityHeaderValue(string value) { } public StringWithQualityHeaderValue(string value, double quality) { } public double? Quality { get { throw null; } } public string Value { get { throw null; } } - public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhen(true)] object? obj) { throw null; } + public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; } public override int GetHashCode() { throw null; } public static System.Net.Http.Headers.StringWithQualityHeaderValue Parse(string? input) { throw null; } object System.ICloneable.Clone() { throw null; } @@ -838,7 +825,7 @@ protected TransferCodingHeaderValue(System.Net.Http.Headers.TransferCodingHeader public TransferCodingHeaderValue(string value) { } public System.Collections.Generic.ICollection Parameters { get { throw null; } } public string Value { get { throw null; } } - public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhen(true)] object? obj) { throw null; } + public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; } public override int GetHashCode() { throw null; } public static System.Net.Http.Headers.TransferCodingHeaderValue Parse(string? input) { throw null; } object System.ICloneable.Clone() { throw null; } @@ -863,7 +850,7 @@ public ViaHeaderValue(string protocolVersion, string receivedBy, string? protoco public string? ProtocolName { get { throw null; } } public string ProtocolVersion { get { throw null; } } public string ReceivedBy { get { throw null; } } - public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhen(true)] object? obj) { throw null; } + public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; } public override int GetHashCode() { throw null; } public static System.Net.Http.Headers.ViaHeaderValue Parse(string? input) { throw null; } object System.ICloneable.Clone() { throw null; } @@ -878,7 +865,7 @@ public WarningHeaderValue(int code, string agent, string text, System.DateTimeOf public int Code { get { throw null; } } public System.DateTimeOffset? Date { get { throw null; } } public string Text { get { throw null; } } - public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhen(true)] object? obj) { throw null; } + public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; } public override int GetHashCode() { throw null; } public static System.Net.Http.Headers.WarningHeaderValue Parse(string? input) { throw null; } object System.ICloneable.Clone() { throw null; } diff --git a/src/libraries/System.Net.Security/ref/System.Net.Security.cs b/src/libraries/System.Net.Security/ref/System.Net.Security.cs index 455bdb09d01ba7..76589add6b2015 100644 --- a/src/libraries/System.Net.Security/ref/System.Net.Security.cs +++ b/src/libraries/System.Net.Security/ref/System.Net.Security.cs @@ -29,9 +29,9 @@ public CipherSuitesPolicy(System.Collections.Generic.IEnumerable ReadAsync(byte[] buffer, int offset, int count, System.Threading.CancellationToken cancellationToken) { throw null; } - public override System.Threading.Tasks.ValueTask ReadAsync(System.Memory buffer, System.Threading.CancellationToken cancellationToken = default) { throw null; } + public override System.Threading.Tasks.ValueTask ReadAsync(System.Memory buffer, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public override long Seek(long offset, System.IO.SeekOrigin origin) { throw null; } public override void SetLength(long value) { } public override void Write(byte[] buffer, int offset, int count) { } public override System.Threading.Tasks.Task WriteAsync(byte[] buffer, int offset, int count, System.Threading.CancellationToken cancellationToken) { throw null; } - public override System.Threading.Tasks.ValueTask WriteAsync(System.ReadOnlyMemory buffer, System.Threading.CancellationToken cancellationToken = default) { throw null; } + public override System.Threading.Tasks.ValueTask WriteAsync(System.ReadOnlyMemory buffer, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } public enum ProtectionLevel { @@ -107,15 +107,9 @@ public enum ProtectionLevel Sign = 1, EncryptAndSign = 2, } - public readonly struct SslClientHelloInfo - { - public string ServerName { get; } - public System.Security.Authentication.SslProtocols SslProtocols { get; } - internal SslClientHelloInfo(string serverName, System.Security.Authentication.SslProtocols sslProtocol) { throw null; } - } public delegate bool RemoteCertificateValidationCallback(object sender, System.Security.Cryptography.X509Certificates.X509Certificate? certificate, System.Security.Cryptography.X509Certificates.X509Chain? chain, System.Net.Security.SslPolicyErrors sslPolicyErrors); public delegate System.Security.Cryptography.X509Certificates.X509Certificate ServerCertificateSelectionCallback(object sender, string? hostName); - public delegate System.Threading.Tasks.ValueTask ServerOptionsSelectionCallback(SslStream stream, SslClientHelloInfo clientHelloInfo, object? state, System.Threading.CancellationToken cancellationToken); + public delegate System.Threading.Tasks.ValueTask ServerOptionsSelectionCallback(System.Net.Security.SslStream stream, System.Net.Security.SslClientHelloInfo clientHelloInfo, object? state, System.Threading.CancellationToken cancellationToken); public readonly partial struct SslApplicationProtocol : System.IEquatable { private readonly object _dummy; @@ -127,30 +121,17 @@ public readonly struct SslClientHelloInfo public SslApplicationProtocol(string protocol) { throw null; } public System.ReadOnlyMemory Protocol { get { throw null; } } public bool Equals(System.Net.Security.SslApplicationProtocol other) { throw null; } - public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhen(true)] object? obj) { throw null; } + public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; } public override int GetHashCode() { throw null; } public static bool operator ==(System.Net.Security.SslApplicationProtocol left, System.Net.Security.SslApplicationProtocol right) { throw null; } public static bool operator !=(System.Net.Security.SslApplicationProtocol left, System.Net.Security.SslApplicationProtocol right) { throw null; } public override string ToString() { throw null; } } - public sealed partial class SslCertificateTrust { - public static SslCertificateTrust CreateForX509Store( - System.Security.Cryptography.X509Certificates.X509Store store, - bool sendTrustInHandshake = false) { throw null; } - public static SslCertificateTrust CreateForX509Collection( - System.Security.Cryptography.X509Certificates.X509Certificate2Collection trustList, - bool sendTrustInHandshake = false) { throw null; } - private SslCertificateTrust() { throw null; } - } - - public sealed partial class SslStreamCertificateContext - { - internal SslStreamCertificateContext() { throw null; } - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - public static SslStreamCertificateContext Create(System.Security.Cryptography.X509Certificates.X509Certificate2 target, System.Security.Cryptography.X509Certificates.X509Certificate2Collection? additionalCertificates, bool offline) { throw null; } - public static SslStreamCertificateContext Create(System.Security.Cryptography.X509Certificates.X509Certificate2 target, System.Security.Cryptography.X509Certificates.X509Certificate2Collection? additionalCertificates, bool offline = false, SslCertificateTrust? trust = null) { throw null; } + internal SslCertificateTrust() { } + public static System.Net.Security.SslCertificateTrust CreateForX509Collection(System.Security.Cryptography.X509Certificates.X509Certificate2Collection trustList, bool sendTrustInHandshake = false) { throw null; } + public static System.Net.Security.SslCertificateTrust CreateForX509Store(System.Security.Cryptography.X509Certificates.X509Store store, bool sendTrustInHandshake = false) { throw null; } } public partial class SslClientAuthenticationOptions { @@ -166,6 +147,13 @@ public SslClientAuthenticationOptions() { } public System.Net.Security.RemoteCertificateValidationCallback? RemoteCertificateValidationCallback { get { throw null; } set { } } public string? TargetHost { get { throw null; } set { } } } + public readonly partial struct SslClientHelloInfo + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public string ServerName { get { throw null; } } + public System.Security.Authentication.SslProtocols SslProtocols { get { throw null; } } + } public partial class SslServerAuthenticationOptions { public SslServerAuthenticationOptions() { } @@ -228,11 +216,11 @@ public void AuthenticateAsServer(System.Net.Security.SslServerAuthenticationOpti public virtual void AuthenticateAsServer(System.Security.Cryptography.X509Certificates.X509Certificate serverCertificate) { } public virtual void AuthenticateAsServer(System.Security.Cryptography.X509Certificates.X509Certificate serverCertificate, bool clientCertificateRequired, bool checkCertificateRevocation) { } public virtual void AuthenticateAsServer(System.Security.Cryptography.X509Certificates.X509Certificate serverCertificate, bool clientCertificateRequired, System.Security.Authentication.SslProtocols enabledSslProtocols, bool checkCertificateRevocation) { } + public System.Threading.Tasks.Task AuthenticateAsServerAsync(System.Net.Security.ServerOptionsSelectionCallback optionsCallback, object? state, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public System.Threading.Tasks.Task AuthenticateAsServerAsync(System.Net.Security.SslServerAuthenticationOptions sslServerAuthenticationOptions, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task AuthenticateAsServerAsync(System.Security.Cryptography.X509Certificates.X509Certificate serverCertificate) { throw null; } public virtual System.Threading.Tasks.Task AuthenticateAsServerAsync(System.Security.Cryptography.X509Certificates.X509Certificate serverCertificate, bool clientCertificateRequired, bool checkCertificateRevocation) { throw null; } public virtual System.Threading.Tasks.Task AuthenticateAsServerAsync(System.Security.Cryptography.X509Certificates.X509Certificate serverCertificate, bool clientCertificateRequired, System.Security.Authentication.SslProtocols enabledSslProtocols, bool checkCertificateRevocation) { throw null; } - public System.Threading.Tasks.Task AuthenticateAsServerAsync(ServerOptionsSelectionCallback optionsCallback, object? state, System.Threading.CancellationToken cancellationToken = default) { throw null; } public virtual System.IAsyncResult BeginAuthenticateAsClient(string targetHost, System.AsyncCallback? asyncCallback, object? asyncState) { throw null; } public virtual System.IAsyncResult BeginAuthenticateAsClient(string targetHost, System.Security.Cryptography.X509Certificates.X509CertificateCollection? clientCertificates, bool checkCertificateRevocation, System.AsyncCallback? asyncCallback, object? asyncState) { throw null; } public virtual System.IAsyncResult BeginAuthenticateAsClient(string targetHost, System.Security.Cryptography.X509Certificates.X509CertificateCollection? clientCertificates, System.Security.Authentication.SslProtocols enabledSslProtocols, bool checkCertificateRevocation, System.AsyncCallback? asyncCallback, object? asyncState) { throw null; } @@ -263,6 +251,13 @@ public override void Write(byte[] buffer, int offset, int count) { } public override System.Threading.Tasks.Task WriteAsync(byte[] buffer, int offset, int count, System.Threading.CancellationToken cancellationToken) { throw null; } public override System.Threading.Tasks.ValueTask WriteAsync(System.ReadOnlyMemory buffer, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } + public partial class SslStreamCertificateContext + { + internal SslStreamCertificateContext() { } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static System.Net.Security.SslStreamCertificateContext Create(System.Security.Cryptography.X509Certificates.X509Certificate2 target, System.Security.Cryptography.X509Certificates.X509Certificate2Collection? additionalCertificates, bool offline) { throw null; } + public static System.Net.Security.SslStreamCertificateContext Create(System.Security.Cryptography.X509Certificates.X509Certificate2 target, System.Security.Cryptography.X509Certificates.X509Certificate2Collection? additionalCertificates, bool offline = false, System.Net.Security.SslCertificateTrust? trust = null) { throw null; } + } [System.CLSCompliantAttribute(false)] public enum TlsCipherSuite : ushort { diff --git a/src/libraries/System.Net.Sockets/ref/System.Net.Sockets.cs b/src/libraries/System.Net.Sockets/ref/System.Net.Sockets.cs index 3eec205b412966..bb455720effca6 100644 --- a/src/libraries/System.Net.Sockets/ref/System.Net.Sockets.cs +++ b/src/libraries/System.Net.Sockets/ref/System.Net.Sockets.cs @@ -80,8 +80,8 @@ public partial struct IPPacketInformation : System.IEquatable buffer) { throw null; } public override System.Threading.Tasks.Task ReadAsync(byte[] buffer, int offset, int count, System.Threading.CancellationToken cancellationToken) { throw null; } - public override System.Threading.Tasks.ValueTask ReadAsync(System.Memory buffer, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public override System.Threading.Tasks.ValueTask ReadAsync(System.Memory buffer, System.Threading.CancellationToken cancellationToken) { throw null; } public override int ReadByte() { throw null; } public override long Seek(long offset, System.IO.SeekOrigin origin) { throw null; } public override void SetLength(long value) { } public override void Write(byte[] buffer, int offset, int count) { } public override void Write(System.ReadOnlySpan buffer) { } public override System.Threading.Tasks.Task WriteAsync(byte[] buffer, int offset, int count, System.Threading.CancellationToken cancellationToken) { throw null; } - public override System.Threading.Tasks.ValueTask WriteAsync(System.ReadOnlyMemory buffer, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public override System.Threading.Tasks.ValueTask WriteAsync(System.ReadOnlyMemory buffer, System.Threading.CancellationToken cancellationToken) { throw null; } public override void WriteByte(byte value) { } } public enum ProtocolFamily @@ -224,6 +224,7 @@ public sealed partial class SafeSocketHandle : Microsoft.Win32.SafeHandles.SafeH { public SafeSocketHandle() : base (default(bool)) { } public SafeSocketHandle(System.IntPtr preexistingHandle, bool ownsHandle) : base (default(bool)) { } + public override bool IsInvalid { get { throw null; } } protected override bool ReleaseHandle() { throw null; } } public enum SelectMode @@ -237,11 +238,11 @@ public partial class SendPacketsElement public SendPacketsElement(byte[] buffer) { } public SendPacketsElement(byte[] buffer, int offset, int count) { } public SendPacketsElement(byte[] buffer, int offset, int count, bool endOfPacket) { } - public SendPacketsElement(ReadOnlyMemory buffer) { } - public SendPacketsElement(ReadOnlyMemory buffer, bool endOfPacket) { } public SendPacketsElement(System.IO.FileStream fileStream) { } public SendPacketsElement(System.IO.FileStream fileStream, long offset, int count) { } public SendPacketsElement(System.IO.FileStream fileStream, long offset, int count, bool endOfPacket) { } + public SendPacketsElement(System.ReadOnlyMemory buffer) { } + public SendPacketsElement(System.ReadOnlyMemory buffer, bool endOfPacket) { } public SendPacketsElement(string filepath) { } public SendPacketsElement(string filepath, int offset, int count) { } public SendPacketsElement(string filepath, int offset, int count, bool endOfPacket) { } @@ -252,14 +253,14 @@ public SendPacketsElement(string filepath, long offset, int count, bool endOfPac public bool EndOfPacket { get { throw null; } } public string? FilePath { get { throw null; } } public System.IO.FileStream? FileStream { get { throw null; } } - public ReadOnlyMemory? MemoryBuffer { get { throw null; } } + public System.ReadOnlyMemory? MemoryBuffer { get { throw null; } } public int Offset { get { throw null; } } public long OffsetLong { get { throw null; } } } public partial class Socket : System.IDisposable { - public Socket(System.Net.Sockets.SafeSocketHandle handle) { } public Socket(System.Net.Sockets.AddressFamily addressFamily, System.Net.Sockets.SocketType socketType, System.Net.Sockets.ProtocolType protocolType) { } + public Socket(System.Net.Sockets.SafeSocketHandle handle) { } [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] public Socket(System.Net.Sockets.SocketInformation socketInformation) { } public Socket(System.Net.Sockets.SocketType socketType, System.Net.Sockets.ProtocolType protocolType) { } @@ -294,15 +295,15 @@ public Socket(System.Net.Sockets.SocketType socketType, System.Net.Sockets.Proto [System.ObsoleteAttribute("SupportsIPv6 has been deprecated. Use OSSupportsIPv6 instead.")] public static bool SupportsIPv6 { get { throw null; } } public short Ttl { get { throw null; } set { } } - [System.ObsoleteAttribute("UseOnlyOverlappedIO has been deprecated and is not supported.")] [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + [System.ObsoleteAttribute("UseOnlyOverlappedIO has been deprecated and is not supported.")] public bool UseOnlyOverlappedIO { get { throw null; } set { } } public System.Net.Sockets.Socket Accept() { throw null; } public System.Threading.Tasks.Task AcceptAsync() { throw null; } - public System.Threading.Tasks.ValueTask AcceptAsync(System.Threading.CancellationToken cancellationToken) { throw null; } public System.Threading.Tasks.Task AcceptAsync(System.Net.Sockets.Socket? acceptSocket) { throw null; } public System.Threading.Tasks.ValueTask AcceptAsync(System.Net.Sockets.Socket? acceptSocket, System.Threading.CancellationToken cancellationToken) { throw null; } public bool AcceptAsync(System.Net.Sockets.SocketAsyncEventArgs e) { throw null; } + public System.Threading.Tasks.ValueTask AcceptAsync(System.Threading.CancellationToken cancellationToken) { throw null; } public System.IAsyncResult BeginAccept(System.AsyncCallback? callback, object? state) { throw null; } public System.IAsyncResult BeginAccept(int receiveSize, System.AsyncCallback? callback, object? state) { throw null; } public System.IAsyncResult BeginAccept(System.Net.Sockets.Socket? acceptSocket, int receiveSize, System.AsyncCallback? callback, object? state) { throw null; } @@ -338,13 +339,13 @@ public void Connect(string host, int port) { } public System.Threading.Tasks.ValueTask ConnectAsync(System.Net.IPAddress address, int port, System.Threading.CancellationToken cancellationToken) { throw null; } public System.Threading.Tasks.Task ConnectAsync(System.Net.IPAddress[] addresses, int port) { throw null; } public System.Threading.Tasks.ValueTask ConnectAsync(System.Net.IPAddress[] addresses, int port, System.Threading.CancellationToken cancellationToken) { throw null; } - public System.Threading.Tasks.Task ConnectAsync(string host, int port) { throw null; } - public System.Threading.Tasks.ValueTask ConnectAsync(string host, int port, System.Threading.CancellationToken cancellationToken) { throw null; } public bool ConnectAsync(System.Net.Sockets.SocketAsyncEventArgs e) { throw null; } public static bool ConnectAsync(System.Net.Sockets.SocketType socketType, System.Net.Sockets.ProtocolType protocolType, System.Net.Sockets.SocketAsyncEventArgs e) { throw null; } + public System.Threading.Tasks.Task ConnectAsync(string host, int port) { throw null; } + public System.Threading.Tasks.ValueTask ConnectAsync(string host, int port, System.Threading.CancellationToken cancellationToken) { throw null; } public void Disconnect(bool reuseSocket) { } + public System.Threading.Tasks.ValueTask DisconnectAsync(bool reuseSocket, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public bool DisconnectAsync(System.Net.Sockets.SocketAsyncEventArgs e) { throw null; } - public System.Threading.Tasks.ValueTask DisconnectAsync(bool reuseSocket, System.Threading.CancellationToken cancellationToken = default) { throw null; } public void Dispose() { } protected virtual void Dispose(bool disposing) { } [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] @@ -388,8 +389,8 @@ public void Listen(int backlog) { } public System.Threading.Tasks.Task ReceiveAsync(System.ArraySegment buffer, System.Net.Sockets.SocketFlags socketFlags) { throw null; } public System.Threading.Tasks.Task ReceiveAsync(System.Collections.Generic.IList> buffers) { throw null; } public System.Threading.Tasks.Task ReceiveAsync(System.Collections.Generic.IList> buffers, System.Net.Sockets.SocketFlags socketFlags) { throw null; } - public System.Threading.Tasks.ValueTask ReceiveAsync(System.Memory buffer, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public System.Threading.Tasks.ValueTask ReceiveAsync(System.Memory buffer, System.Net.Sockets.SocketFlags socketFlags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public System.Threading.Tasks.ValueTask ReceiveAsync(System.Memory buffer, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public bool ReceiveAsync(System.Net.Sockets.SocketAsyncEventArgs e) { throw null; } public int ReceiveFrom(byte[] buffer, int offset, int size, System.Net.Sockets.SocketFlags socketFlags, ref System.Net.EndPoint remoteEP) { throw null; } public int ReceiveFrom(byte[] buffer, int size, System.Net.Sockets.SocketFlags socketFlags, ref System.Net.EndPoint remoteEP) { throw null; } @@ -406,8 +407,8 @@ public void Listen(int backlog) { } public int ReceiveMessageFrom(System.Span buffer, ref System.Net.Sockets.SocketFlags socketFlags, ref System.Net.EndPoint remoteEP, out System.Net.Sockets.IPPacketInformation ipPacketInformation) { throw null; } public System.Threading.Tasks.Task ReceiveMessageFromAsync(System.ArraySegment buffer, System.Net.EndPoint remoteEndPoint) { throw null; } public System.Threading.Tasks.Task ReceiveMessageFromAsync(System.ArraySegment buffer, System.Net.Sockets.SocketFlags socketFlags, System.Net.EndPoint remoteEndPoint) { throw null; } - public System.Threading.Tasks.ValueTask ReceiveMessageFromAsync(System.Memory buffer, System.Net.EndPoint remoteEndPoint, System.Threading.CancellationToken cancellationToken = default) { throw null; } - public System.Threading.Tasks.ValueTask ReceiveMessageFromAsync(System.Memory buffer, System.Net.Sockets.SocketFlags socketFlags, System.Net.EndPoint remoteEndPoint, System.Threading.CancellationToken cancellationToken = default) { throw null; } + public System.Threading.Tasks.ValueTask ReceiveMessageFromAsync(System.Memory buffer, System.Net.EndPoint remoteEndPoint, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public System.Threading.Tasks.ValueTask ReceiveMessageFromAsync(System.Memory buffer, System.Net.Sockets.SocketFlags socketFlags, System.Net.EndPoint remoteEndPoint, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public bool ReceiveMessageFromAsync(System.Net.Sockets.SocketAsyncEventArgs e) { throw null; } public static void Select(System.Collections.IList? checkRead, System.Collections.IList? checkWrite, System.Collections.IList? checkError, int microSeconds) { } public static void Select(System.Collections.IList? checkRead, System.Collections.IList? checkWrite, System.Collections.IList? checkError, System.TimeSpan timeout) { } @@ -426,9 +427,9 @@ public static void Select(System.Collections.IList? checkRead, System.Collection public System.Threading.Tasks.Task SendAsync(System.ArraySegment buffer, System.Net.Sockets.SocketFlags socketFlags) { throw null; } public System.Threading.Tasks.Task SendAsync(System.Collections.Generic.IList> buffers) { throw null; } public System.Threading.Tasks.Task SendAsync(System.Collections.Generic.IList> buffers, System.Net.Sockets.SocketFlags socketFlags) { throw null; } - public System.Threading.Tasks.ValueTask SendAsync(System.ReadOnlyMemory buffer, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public System.Threading.Tasks.ValueTask SendAsync(System.ReadOnlyMemory buffer, System.Net.Sockets.SocketFlags socketFlags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public bool SendAsync(System.Net.Sockets.SocketAsyncEventArgs e) { throw null; } + public System.Threading.Tasks.ValueTask SendAsync(System.ReadOnlyMemory buffer, System.Net.Sockets.SocketFlags socketFlags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public System.Threading.Tasks.ValueTask SendAsync(System.ReadOnlyMemory buffer, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public void SendFile(string? fileName) { } public void SendFile(string? fileName, byte[]? preBuffer, byte[]? postBuffer, System.Net.Sockets.TransmitFileOptions flags) { } public void SendFile(string? fileName, System.ReadOnlySpan preBuffer, System.ReadOnlySpan postBuffer, System.Net.Sockets.TransmitFileOptions flags) { } @@ -443,9 +444,9 @@ public void SendFile(string? fileName, System.ReadOnlySpan preBuffer, Syst public int SendTo(System.ReadOnlySpan buffer, System.Net.Sockets.SocketFlags socketFlags, System.Net.EndPoint remoteEP) { throw null; } public System.Threading.Tasks.Task SendToAsync(System.ArraySegment buffer, System.Net.EndPoint remoteEP) { throw null; } public System.Threading.Tasks.Task SendToAsync(System.ArraySegment buffer, System.Net.Sockets.SocketFlags socketFlags, System.Net.EndPoint remoteEP) { throw null; } + public bool SendToAsync(System.Net.Sockets.SocketAsyncEventArgs e) { throw null; } public System.Threading.Tasks.ValueTask SendToAsync(System.ReadOnlyMemory buffer, System.Net.EndPoint remoteEP, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public System.Threading.Tasks.ValueTask SendToAsync(System.ReadOnlyMemory buffer, System.Net.Sockets.SocketFlags socketFlags, System.Net.EndPoint remoteEP, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public bool SendToAsync(System.Net.Sockets.SocketAsyncEventArgs e) { throw null; } [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] public void SetIPProtectionLevel(System.Net.Sockets.IPProtectionLevel level) { } public void SetRawSocketOption(int optionLevel, int optionName, System.ReadOnlySpan optionValue) { } @@ -525,8 +526,8 @@ public enum SocketInformationOptions NonBlocking = 1, Connected = 2, Listening = 4, - [System.ObsoleteAttribute("SocketInformationOptions.UseOnlyOverlappedIO has been deprecated and is not supported.")] [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + [System.ObsoleteAttribute("SocketInformationOptions.UseOnlyOverlappedIO has been deprecated and is not supported.")] UseOnlyOverlappedIO = 8, } public enum SocketOptionLevel @@ -685,13 +686,13 @@ public void Connect(System.Net.IPAddress[] ipAddresses, int port) { } public void Connect(System.Net.IPEndPoint remoteEP) { } public void Connect(string hostname, int port) { } public System.Threading.Tasks.Task ConnectAsync(System.Net.IPAddress address, int port) { throw null; } - public System.Threading.Tasks.Task ConnectAsync(System.Net.IPAddress[] addresses, int port) { throw null; } - public System.Threading.Tasks.Task ConnectAsync(string host, int port) { throw null; } - public System.Threading.Tasks.Task ConnectAsync(System.Net.IPEndPoint remoteEP) { throw null; } public System.Threading.Tasks.ValueTask ConnectAsync(System.Net.IPAddress address, int port, System.Threading.CancellationToken cancellationToken) { throw null; } + public System.Threading.Tasks.Task ConnectAsync(System.Net.IPAddress[] addresses, int port) { throw null; } public System.Threading.Tasks.ValueTask ConnectAsync(System.Net.IPAddress[] addresses, int port, System.Threading.CancellationToken cancellationToken) { throw null; } - public System.Threading.Tasks.ValueTask ConnectAsync(string host, int port, System.Threading.CancellationToken cancellationToken) { throw null; } + public System.Threading.Tasks.Task ConnectAsync(System.Net.IPEndPoint remoteEP) { throw null; } public System.Threading.Tasks.ValueTask ConnectAsync(System.Net.IPEndPoint remoteEP, System.Threading.CancellationToken cancellationToken) { throw null; } + public System.Threading.Tasks.Task ConnectAsync(string host, int port) { throw null; } + public System.Threading.Tasks.ValueTask ConnectAsync(string host, int port, System.Threading.CancellationToken cancellationToken) { throw null; } public void Dispose() { } protected virtual void Dispose(bool disposing) { } public void EndConnect(System.IAsyncResult asyncResult) { } @@ -779,17 +780,17 @@ public void JoinMulticastGroup(System.Net.IPAddress multicastAddr, System.Net.IP public System.Threading.Tasks.Task ReceiveAsync() { throw null; } public System.Threading.Tasks.ValueTask ReceiveAsync(System.Threading.CancellationToken cancellationToken) { throw null; } public int Send(byte[] dgram, int bytes) { throw null; } - public int Send(System.ReadOnlySpan datagram) {throw null; } public int Send(byte[] dgram, int bytes, System.Net.IPEndPoint? endPoint) { throw null; } - public int Send(System.ReadOnlySpan datagram, System.Net.IPEndPoint? endPoint) { throw null; } public int Send(byte[] dgram, int bytes, string? hostname, int port) { throw null; } + public int Send(System.ReadOnlySpan datagram) { throw null; } + public int Send(System.ReadOnlySpan datagram, System.Net.IPEndPoint? endPoint) { throw null; } public int Send(System.ReadOnlySpan datagram, string? hostname, int port) { throw null; } public System.Threading.Tasks.Task SendAsync(byte[] datagram, int bytes) { throw null; } - public System.Threading.Tasks.ValueTask SendAsync(System.ReadOnlyMemory datagram, System.Threading.CancellationToken cancellationToken = default) { throw null; } public System.Threading.Tasks.Task SendAsync(byte[] datagram, int bytes, System.Net.IPEndPoint? endPoint) { throw null; } - public System.Threading.Tasks.ValueTask SendAsync(System.ReadOnlyMemory datagram, System.Net.IPEndPoint? endPoint, System.Threading.CancellationToken cancellationToken = default) { throw null; } public System.Threading.Tasks.Task SendAsync(byte[] datagram, int bytes, string? hostname, int port) { throw null; } - public System.Threading.Tasks.ValueTask SendAsync(System.ReadOnlyMemory datagram, string? hostname, int port, System.Threading.CancellationToken cancellationToken = default) { throw null; } + public System.Threading.Tasks.ValueTask SendAsync(System.ReadOnlyMemory datagram, System.Net.IPEndPoint? endPoint, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public System.Threading.Tasks.ValueTask SendAsync(System.ReadOnlyMemory datagram, string? hostname, int port, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public System.Threading.Tasks.ValueTask SendAsync(System.ReadOnlyMemory datagram, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } public partial struct UdpReceiveResult : System.IEquatable { @@ -799,7 +800,7 @@ public partial struct UdpReceiveResult : System.IEquatable Date: Wed, 27 Apr 2022 17:42:52 -0700 Subject: [PATCH 2/4] roll back http --- .../System.Net.Http/ref/System.Net.Http.cs | 163 ++++++++++-------- 1 file changed, 88 insertions(+), 75 deletions(-) diff --git a/src/libraries/System.Net.Http/ref/System.Net.Http.cs b/src/libraries/System.Net.Http/ref/System.Net.Http.cs index 5c10452325c38e..b98f4ff8abc968 100644 --- a/src/libraries/System.Net.Http/ref/System.Net.Http.cs +++ b/src/libraries/System.Net.Http/ref/System.Net.Http.cs @@ -4,6 +4,9 @@ // Changes to this file must follow the https://aka.ms/api-review process. // ------------------------------------------------------------------------------ +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; + namespace System.Net.Http { public partial class ByteArrayContent : System.Net.Http.HttpContent @@ -34,7 +37,12 @@ protected override void Dispose(bool disposing) { } } public partial class FormUrlEncodedContent : System.Net.Http.ByteArrayContent { - public FormUrlEncodedContent(System.Collections.Generic.IEnumerable> nameValueCollection) : base (default(byte[])) { } + public FormUrlEncodedContent( + System.Collections.Generic.IEnumerable> nameValueCollection) : base (default(byte[])) { } protected override System.Threading.Tasks.Task SerializeToStreamAsync(System.IO.Stream stream, System.Net.TransportContext? context, System.Threading.CancellationToken cancellationToken) { throw null; } } public delegate System.Text.Encoding? HeaderEncodingSelector(string headerName, TContext context); @@ -131,8 +139,6 @@ public HttpClientHandler() { } public bool PreAuthenticate { get { throw null; } set { } } public System.Collections.Generic.IDictionary Properties { get { throw null; } } [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] - [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("ios")] - [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("tvos")] public System.Net.IWebProxy? Proxy { get { throw null; } set { } } [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] public System.Func? ServerCertificateCustomValidationCallback { get { throw null; } set { } } @@ -148,7 +154,14 @@ public HttpClientHandler() { } [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] public bool UseProxy { get { throw null; } set { } } protected override void Dispose(bool disposing) { } + // + // Attributes are commented out due to https://github.com/dotnet/arcade/issues/7585 + // API compat will fail until this is fixed + // + //[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("android")] [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + //[System.Runtime.Versioning.UnsupportedOSPlatformAttributeUnsupportedOSPlatform("ios")] + //[System.Runtime.Versioning.UnsupportedOSPlatformAttributeUnsupportedOSPlatform("tvos")] protected internal override System.Net.Http.HttpResponseMessage Send(System.Net.Http.HttpRequestMessage request, System.Threading.CancellationToken cancellationToken) { throw null; } protected internal override System.Threading.Tasks.Task SendAsync(System.Net.Http.HttpRequestMessage request, System.Threading.CancellationToken cancellationToken) { throw null; } } @@ -186,11 +199,6 @@ protected virtual void SerializeToStream(System.IO.Stream stream, System.Net.Tra protected virtual System.Threading.Tasks.Task SerializeToStreamAsync(System.IO.Stream stream, System.Net.TransportContext? context, System.Threading.CancellationToken cancellationToken) { throw null; } protected internal abstract bool TryComputeLength(out long length); } - public enum HttpKeepAlivePingPolicy - { - WithActiveRequests = 0, - Always = 1, - } public abstract partial class HttpMessageHandler : System.IDisposable { protected HttpMessageHandler() { } @@ -221,8 +229,8 @@ public HttpMethod(string method) { } public static System.Net.Http.HttpMethod Post { get { throw null; } } public static System.Net.Http.HttpMethod Put { get { throw null; } } public static System.Net.Http.HttpMethod Trace { get { throw null; } } - public bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] System.Net.Http.HttpMethod? other) { throw null; } - public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; } + public bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhen(true)] System.Net.Http.HttpMethod? other) { throw null; } + public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhen(true)] object? obj) { throw null; } public override int GetHashCode() { throw null; } public static bool operator ==(System.Net.Http.HttpMethod? left, System.Net.Http.HttpMethod? right) { throw null; } public static bool operator !=(System.Net.Http.HttpMethod? left, System.Net.Http.HttpMethod? right) { throw null; } @@ -244,9 +252,9 @@ public HttpRequestMessage(System.Net.Http.HttpMethod method, System.Uri? request public System.Net.Http.HttpContent? Content { get { throw null; } set { } } public System.Net.Http.Headers.HttpRequestHeaders Headers { get { throw null; } } public System.Net.Http.HttpMethod Method { get { throw null; } set { } } - public System.Net.Http.HttpRequestOptions Options { get { throw null; } } [System.ObsoleteAttribute("HttpRequestMessage.Properties has been deprecated. Use Options instead.")] public System.Collections.Generic.IDictionary Properties { get { throw null; } } + public HttpRequestOptions Options { get { throw null; } } public System.Uri? RequestUri { get { throw null; } set { } } public System.Version Version { get { throw null; } set { } } public System.Net.Http.HttpVersionPolicy VersionPolicy { get { throw null; } set { } } @@ -254,35 +262,35 @@ public void Dispose() { } protected virtual void Dispose(bool disposing) { } public override string ToString() { throw null; } } - public sealed partial class HttpRequestOptions : System.Collections.Generic.ICollection>, System.Collections.Generic.IDictionary, System.Collections.Generic.IEnumerable>, System.Collections.IEnumerable + + public readonly struct HttpRequestOptionsKey { - public HttpRequestOptions() { } - int System.Collections.Generic.ICollection>.Count { get { throw null; } } - bool System.Collections.Generic.ICollection>.IsReadOnly { get { throw null; } } - object? System.Collections.Generic.IDictionary.this[string key] { get { throw null; } set { } } + public HttpRequestOptionsKey(string key) {} + public string Key { get { throw null; } } + } + + public sealed class HttpRequestOptions : System.Collections.Generic.IDictionary + { + void System.Collections.Generic.IDictionary.Add(string key, object? value) { throw null; } System.Collections.Generic.ICollection System.Collections.Generic.IDictionary.Keys { get { throw null; } } System.Collections.Generic.ICollection System.Collections.Generic.IDictionary.Values { get { throw null; } } - public void Set(System.Net.Http.HttpRequestOptionsKey key, TValue value) { } - void System.Collections.Generic.ICollection>.Add(System.Collections.Generic.KeyValuePair item) { } - void System.Collections.Generic.ICollection>.Clear() { } - bool System.Collections.Generic.ICollection>.Contains(System.Collections.Generic.KeyValuePair item) { throw null; } - void System.Collections.Generic.ICollection>.CopyTo(System.Collections.Generic.KeyValuePair[] array, int arrayIndex) { } - bool System.Collections.Generic.ICollection>.Remove(System.Collections.Generic.KeyValuePair item) { throw null; } - void System.Collections.Generic.IDictionary.Add(string key, object value) { } - bool System.Collections.Generic.IDictionary.ContainsKey(string key) { throw null; } bool System.Collections.Generic.IDictionary.Remove(string key) { throw null; } - bool System.Collections.Generic.IDictionary.TryGetValue(string key, out object value) { throw null; } - System.Collections.Generic.IEnumerator> System.Collections.Generic.IEnumerable>.GetEnumerator() { throw null; } + bool System.Collections.Generic.ICollection>.Remove(System.Collections.Generic.KeyValuePair item) { throw null; } + bool System.Collections.Generic.IDictionary.TryGetValue(string key, out object? value) { throw null; } + object? System.Collections.Generic.IDictionary.this[string key] { get { throw null; } set { } } + void System.Collections.Generic.ICollection>.Add(System.Collections.Generic.KeyValuePair item) { throw null; } + void System.Collections.Generic.ICollection>.Clear() { throw null; } + bool System.Collections.Generic.ICollection>.Contains(System.Collections.Generic.KeyValuePair item) { throw null; } + bool System.Collections.Generic.IDictionary.ContainsKey(string key) { throw null; } + void System.Collections.Generic.ICollection>.CopyTo(System.Collections.Generic.KeyValuePair[] array, int arrayIndex) { throw null; } + int System.Collections.Generic.ICollection>.Count { get { throw null; } } + bool System.Collections.Generic.ICollection>.IsReadOnly { get { throw null; } } + System.Collections.Generic.IEnumerator> System.Collections.Generic.IEnumerable>.GetEnumerator() { throw null; } System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } - public bool TryGetValue(System.Net.Http.HttpRequestOptionsKey key, [System.Diagnostics.CodeAnalysis.MaybeNullWhenAttribute(false)] out TValue value) { throw null; } - } - public readonly partial struct HttpRequestOptionsKey - { - private readonly object _dummy; - private readonly int _dummyPrimitive; - public HttpRequestOptionsKey(string key) { throw null; } - public string Key { get { throw null; } } + public bool TryGetValue(HttpRequestOptionsKey key, [MaybeNullWhen(false)] out TValue value) { throw null; } + public void Set(HttpRequestOptionsKey key, TValue value) { throw null; } } + public partial class HttpResponseMessage : System.IDisposable { public HttpResponseMessage() { } @@ -353,39 +361,28 @@ protected override void SerializeToStream(System.IO.Stream stream, System.Net.Tr protected override System.Threading.Tasks.Task SerializeToStreamAsync(System.IO.Stream stream, System.Net.TransportContext? context, System.Threading.CancellationToken cancellationToken) { throw null; } protected internal override bool TryComputeLength(out long length) { throw null; } } - public sealed partial class SocketsHttpConnectionContext - { - internal SocketsHttpConnectionContext() { } - public System.Net.DnsEndPoint DnsEndPoint { get { throw null; } } - public System.Net.Http.HttpRequestMessage InitialRequestMessage { get { throw null; } } - } [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] public sealed partial class SocketsHttpHandler : System.Net.Http.HttpMessageHandler { public SocketsHttpHandler() { } - [System.CLSCompliantAttribute(false)] - public System.Diagnostics.DistributedContextPropagator? ActivityHeadersPropagator { get { throw null; } set { } } + public int InitialHttp2StreamWindowSize { get { throw null; } set { } } + [System.Runtime.Versioning.UnsupportedOSPlatformGuardAttribute("browser")] + public static bool IsSupported { get { throw null; } } public bool AllowAutoRedirect { get { throw null; } set { } } public System.Net.DecompressionMethods AutomaticDecompression { get { throw null; } set { } } - public System.Func>? ConnectCallback { get { throw null; } set { } } public System.TimeSpan ConnectTimeout { get { throw null; } set { } } [System.Diagnostics.CodeAnalysis.AllowNullAttribute] 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 bool EnableMultipleHttp2Connections { get { throw null; } set { } } public System.TimeSpan Expect100ContinueTimeout { get { throw null; } set { } } - public int InitialHttp2StreamWindowSize { get { throw null; } set { } } - [System.Runtime.Versioning.UnsupportedOSPlatformGuardAttribute("browser")] - public static bool IsSupported { get { throw null; } } public System.TimeSpan KeepAlivePingDelay { get { throw null; } set { } } - public System.Net.Http.HttpKeepAlivePingPolicy KeepAlivePingPolicy { get { throw null; } set { } } public System.TimeSpan KeepAlivePingTimeout { get { throw null; } set { } } + public HttpKeepAlivePingPolicy KeepAlivePingPolicy { get { throw null; } set { } } public int MaxAutomaticRedirections { get { throw null; } set { } } public int MaxConnectionsPerServer { get { throw null; } set { } } public int MaxResponseDrainSize { get { throw null; } set { } } public int MaxResponseHeadersLength { get { throw null; } set { } } - public System.Func>? PlaintextStreamFilter { get { throw null; } set { } } public System.TimeSpan PooledConnectionIdleTimeout { get { throw null; } set { } } public System.TimeSpan PooledConnectionLifetime { get { throw null; } set { } } public bool PreAuthenticate { get { throw null; } set { } } @@ -401,13 +398,29 @@ public SocketsHttpHandler() { } protected override void Dispose(bool disposing) { } protected internal override System.Net.Http.HttpResponseMessage Send(System.Net.Http.HttpRequestMessage request, System.Threading.CancellationToken cancellationToken) { throw null; } protected internal override System.Threading.Tasks.Task SendAsync(System.Net.Http.HttpRequestMessage request, System.Threading.CancellationToken cancellationToken) { throw null; } + public bool EnableMultipleHttp2Connections { get { throw null; } set { } } + public Func>? ConnectCallback { get { throw null; } set { } } + public Func>? PlaintextStreamFilter { get { throw null; } set { } } + [System.CLSCompliantAttribute(false)] + public System.Diagnostics.DistributedContextPropagator? ActivityHeadersPropagator { get { throw null; } set { } } } - public sealed partial class SocketsHttpPlaintextStreamFilterContext + public sealed class SocketsHttpConnectionContext + { + internal SocketsHttpConnectionContext() { } + public DnsEndPoint DnsEndPoint { get { throw null; } } + public HttpRequestMessage InitialRequestMessage { get { throw null; } } + } + public sealed class SocketsHttpPlaintextStreamFilterContext { internal SocketsHttpPlaintextStreamFilterContext() { } - public System.Net.Http.HttpRequestMessage InitialRequestMessage { get { throw null; } } - public System.Version NegotiatedHttpVersion { get { throw null; } } public System.IO.Stream PlaintextStream { get { throw null; } } + public Version NegotiatedHttpVersion { get { throw null; } } + public HttpRequestMessage InitialRequestMessage { get { throw null; } } + } + public enum HttpKeepAlivePingPolicy + { + WithActiveRequests, + Always } public partial class StreamContent : System.Net.Http.HttpContent { @@ -439,7 +452,7 @@ public AuthenticationHeaderValue(string scheme) { } public AuthenticationHeaderValue(string scheme, string? parameter) { } public string? Parameter { get { throw null; } } public string Scheme { get { throw null; } } - public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; } + public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhen(true)] object? obj) { throw null; } public override int GetHashCode() { throw null; } public static System.Net.Http.Headers.AuthenticationHeaderValue Parse(string? input) { throw null; } object System.ICloneable.Clone() { throw null; } @@ -465,7 +478,7 @@ public CacheControlHeaderValue() { } public bool ProxyRevalidate { get { throw null; } set { } } public bool Public { get { throw null; } set { } } public System.TimeSpan? SharedMaxAge { get { throw null; } set { } } - public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; } + public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhen(true)] object? obj) { throw null; } public override int GetHashCode() { throw null; } public static System.Net.Http.Headers.CacheControlHeaderValue Parse(string? input) { throw null; } object System.ICloneable.Clone() { throw null; } @@ -485,10 +498,10 @@ public ContentDispositionHeaderValue(string dispositionType) { } public System.Collections.Generic.ICollection Parameters { get { throw null; } } public System.DateTimeOffset? ReadDate { get { throw null; } set { } } public long? Size { get { throw null; } set { } } - public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; } + public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhen(true)] object? obj) { throw null; } public override int GetHashCode() { throw null; } public static System.Net.Http.Headers.ContentDispositionHeaderValue Parse(string? input) { throw null; } - object? System.ICloneable.Clone() { throw null; } + object System.ICloneable.Clone() { throw null; } public override string ToString() { throw null; } public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? input, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] out System.Net.Http.Headers.ContentDispositionHeaderValue? parsedValue) { throw null; } } @@ -503,7 +516,7 @@ public ContentRangeHeaderValue(long from, long to, long length) { } public long? Length { get { throw null; } } public long? To { get { throw null; } } public string Unit { get { throw null; } set { } } - public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; } + public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhen(true)] object? obj) { throw null; } public override int GetHashCode() { throw null; } public static System.Net.Http.Headers.ContentRangeHeaderValue Parse(string? input) { throw null; } object System.ICloneable.Clone() { throw null; } @@ -517,7 +530,7 @@ public EntityTagHeaderValue(string tag, bool isWeak) { } public static System.Net.Http.Headers.EntityTagHeaderValue Any { get { throw null; } } public bool IsWeak { get { throw null; } } public string Tag { get { throw null; } } - public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; } + public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhen(true)] object? obj) { throw null; } public override int GetHashCode() { throw null; } public static System.Net.Http.Headers.EntityTagHeaderValue Parse(string? input) { throw null; } object System.ICloneable.Clone() { throw null; } @@ -585,12 +598,12 @@ public void Clear() { } System.Collections.Generic.IEnumerable System.Collections.Generic.IReadOnlyDictionary.Keys { get { throw null; } } System.Collections.Generic.IEnumerable System.Collections.Generic.IReadOnlyDictionary.Values { get { throw null; } } public bool Contains(string headerName) { throw null; } + bool System.Collections.Generic.IReadOnlyDictionary.ContainsKey(string key) { throw null; } public System.Net.Http.Headers.HttpHeadersNonValidated.Enumerator GetEnumerator() { throw null; } System.Collections.Generic.IEnumerator> System.Collections.Generic.IEnumerable>.GetEnumerator() { throw null; } - bool System.Collections.Generic.IReadOnlyDictionary.ContainsKey(string key) { throw null; } - bool System.Collections.Generic.IReadOnlyDictionary.TryGetValue(string key, out System.Net.Http.Headers.HeaderStringValues value) { throw null; } System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } public bool TryGetValues(string headerName, out System.Net.Http.Headers.HeaderStringValues values) { throw null; } + bool System.Collections.Generic.IReadOnlyDictionary.TryGetValue(string key, out System.Net.Http.Headers.HeaderStringValues value) { throw null; } public partial struct Enumerator : System.Collections.Generic.IEnumerator>, System.Collections.IEnumerator, System.IDisposable { private object _dummy; @@ -686,10 +699,10 @@ public MediaTypeHeaderValue(string mediaType, string? charSet) { } [System.Diagnostics.CodeAnalysis.DisallowNullAttribute] public string? MediaType { get { throw null; } set { } } public System.Collections.Generic.ICollection Parameters { get { throw null; } } - public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; } + public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhen(true)] object? obj) { throw null; } public override int GetHashCode() { throw null; } public static System.Net.Http.Headers.MediaTypeHeaderValue Parse(string? input) { throw null; } - object? System.ICloneable.Clone() { throw null; } + object System.ICloneable.Clone() { throw null; } public override string ToString() { throw null; } public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? input, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] out System.Net.Http.Headers.MediaTypeHeaderValue? parsedValue) { throw null; } } @@ -704,12 +717,12 @@ public MediaTypeWithQualityHeaderValue(string mediaType, double quality) : base } public partial class NameValueHeaderValue : System.ICloneable { - protected internal NameValueHeaderValue(System.Net.Http.Headers.NameValueHeaderValue source) { } + protected NameValueHeaderValue(System.Net.Http.Headers.NameValueHeaderValue source) { } public NameValueHeaderValue(string name) { } public NameValueHeaderValue(string name, string? value) { } public string Name { get { throw null; } } public string? Value { get { throw null; } set { } } - public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; } + public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhen(true)] object? obj) { throw null; } public override int GetHashCode() { throw null; } public static System.Net.Http.Headers.NameValueHeaderValue Parse(string? input) { throw null; } object System.ICloneable.Clone() { throw null; } @@ -722,7 +735,7 @@ protected NameValueWithParametersHeaderValue(System.Net.Http.Headers.NameValueWi public NameValueWithParametersHeaderValue(string name) : base (default(string)) { } public NameValueWithParametersHeaderValue(string name, string? value) : base (default(string)) { } public System.Collections.Generic.ICollection Parameters { get { throw null; } } - public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; } + public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhen(true)] object? obj) { throw null; } public override int GetHashCode() { throw null; } public static new System.Net.Http.Headers.NameValueWithParametersHeaderValue Parse(string? input) { throw null; } object System.ICloneable.Clone() { throw null; } @@ -735,7 +748,7 @@ public ProductHeaderValue(string name) { } public ProductHeaderValue(string name, string? version) { } public string Name { get { throw null; } } public string? Version { get { throw null; } } - public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; } + public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhen(true)] object? obj) { throw null; } public override int GetHashCode() { throw null; } public static System.Net.Http.Headers.ProductHeaderValue Parse(string? input) { throw null; } object System.ICloneable.Clone() { throw null; } @@ -749,7 +762,7 @@ public ProductInfoHeaderValue(string comment) { } public ProductInfoHeaderValue(string productName, string? productVersion) { } public string? Comment { get { throw null; } } public System.Net.Http.Headers.ProductHeaderValue? Product { get { throw null; } } - public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; } + public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhen(true)] object? obj) { throw null; } public override int GetHashCode() { throw null; } public static System.Net.Http.Headers.ProductInfoHeaderValue Parse(string input) { throw null; } object System.ICloneable.Clone() { throw null; } @@ -763,7 +776,7 @@ public RangeConditionHeaderValue(System.Net.Http.Headers.EntityTagHeaderValue en public RangeConditionHeaderValue(string entityTag) { } public System.DateTimeOffset? Date { get { throw null; } } public System.Net.Http.Headers.EntityTagHeaderValue? EntityTag { get { throw null; } } - public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; } + public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhen(true)] object? obj) { throw null; } public override int GetHashCode() { throw null; } public static System.Net.Http.Headers.RangeConditionHeaderValue Parse(string? input) { throw null; } object System.ICloneable.Clone() { throw null; } @@ -776,7 +789,7 @@ public RangeHeaderValue() { } public RangeHeaderValue(long? from, long? to) { } public System.Collections.Generic.ICollection Ranges { get { throw null; } } public string Unit { get { throw null; } set { } } - public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; } + public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhen(true)] object? obj) { throw null; } public override int GetHashCode() { throw null; } public static System.Net.Http.Headers.RangeHeaderValue Parse(string? input) { throw null; } object System.ICloneable.Clone() { throw null; } @@ -788,7 +801,7 @@ public partial class RangeItemHeaderValue : System.ICloneable public RangeItemHeaderValue(long? from, long? to) { } public long? From { get { throw null; } } public long? To { get { throw null; } } - public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; } + public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhen(true)] object? obj) { throw null; } public override int GetHashCode() { throw null; } object System.ICloneable.Clone() { throw null; } public override string ToString() { throw null; } @@ -799,7 +812,7 @@ public RetryConditionHeaderValue(System.DateTimeOffset date) { } public RetryConditionHeaderValue(System.TimeSpan delta) { } public System.DateTimeOffset? Date { get { throw null; } } public System.TimeSpan? Delta { get { throw null; } } - public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; } + public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhen(true)] object? obj) { throw null; } public override int GetHashCode() { throw null; } public static System.Net.Http.Headers.RetryConditionHeaderValue Parse(string? input) { throw null; } object System.ICloneable.Clone() { throw null; } @@ -812,7 +825,7 @@ public StringWithQualityHeaderValue(string value) { } public StringWithQualityHeaderValue(string value, double quality) { } public double? Quality { get { throw null; } } public string Value { get { throw null; } } - public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; } + public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhen(true)] object? obj) { throw null; } public override int GetHashCode() { throw null; } public static System.Net.Http.Headers.StringWithQualityHeaderValue Parse(string? input) { throw null; } object System.ICloneable.Clone() { throw null; } @@ -825,7 +838,7 @@ protected TransferCodingHeaderValue(System.Net.Http.Headers.TransferCodingHeader public TransferCodingHeaderValue(string value) { } public System.Collections.Generic.ICollection Parameters { get { throw null; } } public string Value { get { throw null; } } - public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; } + public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhen(true)] object? obj) { throw null; } public override int GetHashCode() { throw null; } public static System.Net.Http.Headers.TransferCodingHeaderValue Parse(string? input) { throw null; } object System.ICloneable.Clone() { throw null; } @@ -850,7 +863,7 @@ public ViaHeaderValue(string protocolVersion, string receivedBy, string? protoco public string? ProtocolName { get { throw null; } } public string ProtocolVersion { get { throw null; } } public string ReceivedBy { get { throw null; } } - public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; } + public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhen(true)] object? obj) { throw null; } public override int GetHashCode() { throw null; } public static System.Net.Http.Headers.ViaHeaderValue Parse(string? input) { throw null; } object System.ICloneable.Clone() { throw null; } @@ -865,7 +878,7 @@ public WarningHeaderValue(int code, string agent, string text, System.DateTimeOf public int Code { get { throw null; } } public System.DateTimeOffset? Date { get { throw null; } } public string Text { get { throw null; } } - public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; } + public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhen(true)] object? obj) { throw null; } public override int GetHashCode() { throw null; } public static System.Net.Http.Headers.WarningHeaderValue Parse(string? input) { throw null; } object System.ICloneable.Clone() { throw null; } From a555a4d9b4036eebd0faa4d101fa95db5f822a42 Mon Sep 17 00:00:00 2001 From: wfurt Date: Mon, 2 May 2022 13:01:38 -0700 Subject: [PATCH 3/4] add System.Net.Primitives --- .../System.Net.Primitives/ref/System.Net.Primitives.cs | 10 +++++----- .../src/ReferenceAssemblyExclusions.txt | 3 +++ .../src/System.Net.Primitives.csproj | 1 + 3 files changed, 9 insertions(+), 5 deletions(-) create mode 100644 src/libraries/System.Net.Primitives/src/ReferenceAssemblyExclusions.txt diff --git a/src/libraries/System.Net.Primitives/ref/System.Net.Primitives.cs b/src/libraries/System.Net.Primitives/ref/System.Net.Primitives.cs index 6aa30c59700426..00250e07d8f328 100644 --- a/src/libraries/System.Net.Primitives/ref/System.Net.Primitives.cs +++ b/src/libraries/System.Net.Primitives/ref/System.Net.Primitives.cs @@ -81,9 +81,9 @@ public void Add(System.Net.Cookie cookie) { } public void Add(System.Net.CookieCollection cookies) { } public void Add(System.Uri uri, System.Net.Cookie cookie) { } public void Add(System.Uri uri, System.Net.CookieCollection cookies) { } + public System.Net.CookieCollection GetAllCookies() { throw null; } public string GetCookieHeader(System.Uri uri) { throw null; } public System.Net.CookieCollection GetCookies(System.Uri uri) { throw null; } - public System.Net.CookieCollection GetAllCookies() { throw null; } public void SetCookies(System.Uri uri, string cookieHeader) { } } public partial class CookieException : System.FormatException, System.Runtime.Serialization.ISerializable @@ -516,11 +516,11 @@ public enum SslProtocols Ssl2 = 12, [System.ObsoleteAttribute("SslProtocols.Ssl3 has been deprecated and is not supported.")] Ssl3 = 48, - [System.ObsoleteAttribute("TLS versions 1.0 and 1.1 have known vulnerabilities and are not recommended. Use a newer TLS version instead, or use SslProtocols.None to defer to OS defaults.", DiagnosticId = "SYSLIB0039", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] + [System.ObsoleteAttribute("TLS versions 1.0 and 1.1 have known vulnerabilities and are not recommended. Use a newer TLS version instead, or use SslProtocols.None to defer to OS defaults.", DiagnosticId="SYSLIB0039", UrlFormat="https://aka.ms/dotnet-warnings/{0}")] Tls = 192, [System.ObsoleteAttribute("SslProtocols.Default has been deprecated and is not supported.")] Default = 240, - [System.ObsoleteAttribute("TLS versions 1.0 and 1.1 have known vulnerabilities and are not recommended. Use a newer TLS version instead, or use SslProtocols.None to defer to OS defaults.", DiagnosticId = "SYSLIB0039", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] + [System.ObsoleteAttribute("TLS versions 1.0 and 1.1 have known vulnerabilities and are not recommended. Use a newer TLS version instead, or use SslProtocols.None to defer to OS defaults.", DiagnosticId="SYSLIB0039", UrlFormat="https://aka.ms/dotnet-warnings/{0}")] Tls11 = 768, Tls12 = 3072, Tls13 = 12288, @@ -530,8 +530,8 @@ namespace System.Security.Authentication.ExtendedProtection { public abstract partial class ChannelBinding : Microsoft.Win32.SafeHandles.SafeHandleZeroOrMinusOneIsInvalid { - protected ChannelBinding() : base(default(bool)) { } - protected ChannelBinding(bool ownsHandle) : base(default(bool)) { } + protected ChannelBinding() : base (default(bool)) { } + protected ChannelBinding(bool ownsHandle) : base (default(bool)) { } public abstract int Size { get; } } public enum ChannelBindingKind diff --git a/src/libraries/System.Net.Primitives/src/ReferenceAssemblyExclusions.txt b/src/libraries/System.Net.Primitives/src/ReferenceAssemblyExclusions.txt new file mode 100644 index 00000000000000..a7985395c17729 --- /dev/null +++ b/src/libraries/System.Net.Primitives/src/ReferenceAssemblyExclusions.txt @@ -0,0 +1,3 @@ +# Needed for serialization +T:System.Net.CookieVariant +T:System.Net.PathList diff --git a/src/libraries/System.Net.Primitives/src/System.Net.Primitives.csproj b/src/libraries/System.Net.Primitives/src/System.Net.Primitives.csproj index 00e7da3d4da3c9..84a5864cac9025 100644 --- a/src/libraries/System.Net.Primitives/src/System.Net.Primitives.csproj +++ b/src/libraries/System.Net.Primitives/src/System.Net.Primitives.csproj @@ -11,6 +11,7 @@ $([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) SR.PlatformNotSupported_NetPrimitives + ReferenceAssemblyExclusions.txt From f9913788c141d0f6d9fa52cada65b54dfbf237ee Mon Sep 17 00:00:00 2001 From: wfurt Date: Mon, 2 May 2022 13:15:14 -0700 Subject: [PATCH 4/4] update defaults --- src/libraries/System.Net.Sockets/ref/System.Net.Sockets.cs | 4 ++-- .../src/System/Net/Sockets/NetworkStream.cs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/libraries/System.Net.Sockets/ref/System.Net.Sockets.cs b/src/libraries/System.Net.Sockets/ref/System.Net.Sockets.cs index bb455720effca6..e60d1d45653342 100644 --- a/src/libraries/System.Net.Sockets/ref/System.Net.Sockets.cs +++ b/src/libraries/System.Net.Sockets/ref/System.Net.Sockets.cs @@ -146,14 +146,14 @@ public override void Flush() { } public override int Read(byte[] buffer, int offset, int count) { throw null; } public override int Read(System.Span buffer) { throw null; } public override System.Threading.Tasks.Task ReadAsync(byte[] buffer, int offset, int count, System.Threading.CancellationToken cancellationToken) { throw null; } - public override System.Threading.Tasks.ValueTask ReadAsync(System.Memory buffer, System.Threading.CancellationToken cancellationToken) { throw null; } + public override System.Threading.Tasks.ValueTask ReadAsync(System.Memory buffer, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public override int ReadByte() { throw null; } public override long Seek(long offset, System.IO.SeekOrigin origin) { throw null; } public override void SetLength(long value) { } public override void Write(byte[] buffer, int offset, int count) { } public override void Write(System.ReadOnlySpan buffer) { } public override System.Threading.Tasks.Task WriteAsync(byte[] buffer, int offset, int count, System.Threading.CancellationToken cancellationToken) { throw null; } - public override System.Threading.Tasks.ValueTask WriteAsync(System.ReadOnlyMemory buffer, System.Threading.CancellationToken cancellationToken) { throw null; } + public override System.Threading.Tasks.ValueTask WriteAsync(System.ReadOnlyMemory buffer, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public override void WriteByte(byte value) { } } public enum ProtocolFamily diff --git a/src/libraries/System.Net.Sockets/src/System/Net/Sockets/NetworkStream.cs b/src/libraries/System.Net.Sockets/src/System/Net/Sockets/NetworkStream.cs index 23b2883a702fc1..33d4fb975a2e75 100644 --- a/src/libraries/System.Net.Sockets/src/System/Net/Sockets/NetworkStream.cs +++ b/src/libraries/System.Net.Sockets/src/System/Net/Sockets/NetworkStream.cs @@ -541,7 +541,7 @@ public override Task ReadAsync(byte[] buffer, int offset, int count, Cancel } } - public override ValueTask ReadAsync(Memory buffer, CancellationToken cancellationToken) + public override ValueTask ReadAsync(Memory buffer, CancellationToken cancellationToken = default) { bool canRead = CanRead; // Prevent race with Dispose. ThrowIfDisposed(); @@ -601,7 +601,7 @@ public override Task WriteAsync(byte[] buffer, int offset, int count, Cancellati } } - public override ValueTask WriteAsync(ReadOnlyMemory buffer, CancellationToken cancellationToken) + public override ValueTask WriteAsync(ReadOnlyMemory buffer, CancellationToken cancellationToken = default) { bool canWrite = CanWrite; // Prevent race with Dispose. ThrowIfDisposed();