Migration
This commit is contained in:
parent
f2f4813023
commit
9168442704
|
|
@ -28,4 +28,5 @@ project.lock.json
|
|||
.build/
|
||||
.testPublish/
|
||||
/.vs/
|
||||
.vscode/
|
||||
global.json
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<Import Project="..\..\build\dependencies.props" />
|
||||
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>netcoreapp2.0;net46</TargetFrameworks>
|
||||
<TargetFramework>netcoreapp2.0</TargetFramework>
|
||||
<OutputType>Exe</OutputType>
|
||||
</PropertyGroup>
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
<Import Project="..\..\build\common.props" />
|
||||
<PropertyGroup>
|
||||
<Description>ASP.NET Core common types used by the various authentication components.</Description>
|
||||
<TargetFrameworks>netstandard1.3;net46</TargetFrameworks>
|
||||
<TargetFramework>netcoreapp2.0</TargetFramework>
|
||||
<NoWarn>$(NoWarn);CS1591</NoWarn>
|
||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||
<PackageTags>aspnetcore;authentication;security</PackageTags>
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
<PropertyGroup>
|
||||
<Description>ASP.NET Core common types used by the various authentication middleware components.</Description>
|
||||
<TargetFrameworks>netstandard1.3;net46</TargetFrameworks>
|
||||
<TargetFramework>netcoreapp2.0</TargetFramework>
|
||||
<NoWarn>$(NoWarn);CS1591</NoWarn>
|
||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||
<PackageTags>aspnetcore;authentication;security</PackageTags>
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ Microsoft.AspNetCore.Builder.IApplicationBuilder
|
|||
Microsoft.AspNetCore.Http.HttpContext
|
||||
Microsoft.AspNetCore.Http.HttpRequest
|
||||
Microsoft.AspNetCore.Http.HttpResponse</Description>
|
||||
<TargetFramework>netstandard1.3</TargetFramework>
|
||||
<TargetFramework>netcoreapp2.0</TargetFramework>
|
||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||
<PackageTags>aspnetcore</PackageTags>
|
||||
<NoWarn>$(NoWarn);CS1591</NoWarn>
|
||||
|
|
@ -26,9 +26,4 @@ Microsoft.AspNetCore.Http.HttpResponse</Description>
|
|||
<PackageReference Include="System.Text.Encodings.Web" Version="$(CoreFxVersion)" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard1.3' ">
|
||||
<PackageReference Include="System.Globalization.Extensions" Version="$(CoreFxVersion)" />
|
||||
<PackageReference Include="System.Reflection.TypeExtensions" Version="$(CoreFxVersion)" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
<PropertyGroup>
|
||||
<Description>ASP.NET Core common extension methods for HTTP abstractions, HTTP headers, HTTP request/response, and session state.</Description>
|
||||
<TargetFramework>netstandard1.3</TargetFramework>
|
||||
<TargetFramework>netcoreapp2.0</TargetFramework>
|
||||
<NoWarn>$(NoWarn);CS1591</NoWarn>
|
||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||
<PackageTags>aspnetcore</PackageTags>
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
<PropertyGroup>
|
||||
<Description>ASP.NET Core HTTP feature interface definitions.</Description>
|
||||
<TargetFramework>netstandard1.3</TargetFramework>
|
||||
<TargetFramework>netcoreapp2.0</TargetFramework>
|
||||
<NoWarn>$(NoWarn);CS1591</NoWarn>
|
||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||
<PackageTags>aspnetcore</PackageTags>
|
||||
|
|
@ -17,9 +17,4 @@
|
|||
<PackageReference Include="System.Security.Principal" Version="$(CoreFxVersion)" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard1.3' ">
|
||||
<PackageReference Include="System.Security.Claims" Version="$(CoreFxVersion)" />
|
||||
<PackageReference Include="System.Net.WebSockets" Version="$(CoreFxVersion)" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,14 +0,0 @@
|
|||
[
|
||||
{
|
||||
"OldTypeId": "public interface Microsoft.AspNetCore.Http.IHeaderDictionary : System.Collections.Generic.IDictionary<System.String, Microsoft.Extensions.Primitives.StringValues>",
|
||||
"NewTypeId": "public interface Microsoft.AspNetCore.Http.IHeaderDictionary : System.Collections.Generic.IDictionary<System.String, Microsoft.Extensions.Primitives.StringValues>",
|
||||
"NewMemberId": "System.Nullable<System.Int64> get_ContentLength()",
|
||||
"Kind": "Addition"
|
||||
},
|
||||
{
|
||||
"OldTypeId": "public interface Microsoft.AspNetCore.Http.IHeaderDictionary : System.Collections.Generic.IDictionary<System.String, Microsoft.Extensions.Primitives.StringValues>",
|
||||
"NewTypeId": "public interface Microsoft.AspNetCore.Http.IHeaderDictionary : System.Collections.Generic.IDictionary<System.String, Microsoft.Extensions.Primitives.StringValues>",
|
||||
"NewMemberId": "System.Void set_ContentLength(System.Nullable<System.Int64> value)",
|
||||
"Kind": "Addition"
|
||||
}
|
||||
]
|
||||
|
|
@ -115,68 +115,7 @@ namespace Microsoft.AspNetCore.Http.Internal
|
|||
_position += read;
|
||||
return read;
|
||||
}
|
||||
#if NET46
|
||||
public override IAsyncResult BeginRead(byte[] buffer, int offset, int count, AsyncCallback callback, object state)
|
||||
{
|
||||
ThrowIfDisposed();
|
||||
VerifyPosition();
|
||||
var tcs = new TaskCompletionSource<int>(state);
|
||||
BeginRead(buffer, offset, count, callback, tcs);
|
||||
return tcs.Task;
|
||||
}
|
||||
|
||||
private async void BeginRead(byte[] buffer, int offset, int count, AsyncCallback callback, TaskCompletionSource<int> tcs)
|
||||
{
|
||||
try
|
||||
{
|
||||
var read = await ReadAsync(buffer, offset, count);
|
||||
tcs.TrySetResult(read);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
tcs.TrySetException(ex);
|
||||
}
|
||||
|
||||
if (callback != null)
|
||||
{
|
||||
// Offload callbacks to avoid stack dives on sync completions.
|
||||
var ignored = Task.Run(() =>
|
||||
{
|
||||
try
|
||||
{
|
||||
callback(tcs.Task);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
// Suppress exceptions on background threads.
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public override int EndRead(IAsyncResult asyncResult)
|
||||
{
|
||||
if (asyncResult == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(asyncResult));
|
||||
}
|
||||
|
||||
var task = (Task<int>)asyncResult;
|
||||
return task.GetAwaiter().GetResult();
|
||||
}
|
||||
public override IAsyncResult BeginWrite(byte[] buffer, int offset, int count, AsyncCallback callback, object state)
|
||||
{
|
||||
throw new NotSupportedException();
|
||||
}
|
||||
|
||||
public override void EndWrite(IAsyncResult asyncResult)
|
||||
{
|
||||
throw new NotSupportedException();
|
||||
}
|
||||
#elif NETSTANDARD1_3
|
||||
#else
|
||||
#error Target frameworks need to be updated.
|
||||
#endif
|
||||
public override void Write(byte[] buffer, int offset, int count)
|
||||
{
|
||||
throw new NotSupportedException();
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
<PropertyGroup>
|
||||
<Description>ASP.NET Core default HTTP feature implementations.</Description>
|
||||
<TargetFrameworks>netstandard1.3;net46</TargetFrameworks>
|
||||
<TargetFramework>netcoreapp2.0</TargetFramework>
|
||||
<NoWarn>$(NoWarn);CS1591</NoWarn>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
<PropertyGroup>
|
||||
<Description>ASP.NET Core component for running OWIN middleware in an ASP.NET Core application, and to run ASP.NET Core middleware in an OWIN application.</Description>
|
||||
<TargetFramework>netstandard1.3</TargetFramework>
|
||||
<TargetFramework>netcoreapp2.0</TargetFramework>
|
||||
<NoWarn>$(NoWarn);CS1591</NoWarn>
|
||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||
<PackageTags>aspnetcore;owin</PackageTags>
|
||||
|
|
|
|||
|
|
@ -1,999 +0,0 @@
|
|||
{
|
||||
"AssemblyIdentity": "Microsoft.AspNetCore.Owin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60",
|
||||
"Types": [
|
||||
{
|
||||
"Name": "Microsoft.AspNetCore.Builder.OwinExtensions",
|
||||
"Visibility": "Public",
|
||||
"Kind": "Class",
|
||||
"Abstract": true,
|
||||
"Static": true,
|
||||
"Sealed": true,
|
||||
"ImplementedInterfaces": [],
|
||||
"Members": [
|
||||
{
|
||||
"Kind": "Method",
|
||||
"Name": "UseOwin",
|
||||
"Parameters": [
|
||||
{
|
||||
"Name": "builder",
|
||||
"Type": "Microsoft.AspNetCore.Builder.IApplicationBuilder"
|
||||
}
|
||||
],
|
||||
"ReturnType": "System.Action<System.Func<System.Func<System.Collections.Generic.IDictionary<System.String, System.Object>, System.Threading.Tasks.Task>, System.Func<System.Collections.Generic.IDictionary<System.String, System.Object>, System.Threading.Tasks.Task>>>",
|
||||
"Static": true,
|
||||
"Extension": true,
|
||||
"Visibility": "Public",
|
||||
"GenericParameter": []
|
||||
},
|
||||
{
|
||||
"Kind": "Method",
|
||||
"Name": "UseOwin",
|
||||
"Parameters": [
|
||||
{
|
||||
"Name": "builder",
|
||||
"Type": "Microsoft.AspNetCore.Builder.IApplicationBuilder"
|
||||
},
|
||||
{
|
||||
"Name": "pipeline",
|
||||
"Type": "System.Action<System.Action<System.Func<System.Func<System.Collections.Generic.IDictionary<System.String, System.Object>, System.Threading.Tasks.Task>, System.Func<System.Collections.Generic.IDictionary<System.String, System.Object>, System.Threading.Tasks.Task>>>>"
|
||||
}
|
||||
],
|
||||
"ReturnType": "Microsoft.AspNetCore.Builder.IApplicationBuilder",
|
||||
"Static": true,
|
||||
"Extension": true,
|
||||
"Visibility": "Public",
|
||||
"GenericParameter": []
|
||||
},
|
||||
{
|
||||
"Kind": "Method",
|
||||
"Name": "UseBuilder",
|
||||
"Parameters": [
|
||||
{
|
||||
"Name": "app",
|
||||
"Type": "System.Action<System.Func<System.Func<System.Collections.Generic.IDictionary<System.String, System.Object>, System.Threading.Tasks.Task>, System.Func<System.Collections.Generic.IDictionary<System.String, System.Object>, System.Threading.Tasks.Task>>>"
|
||||
}
|
||||
],
|
||||
"ReturnType": "Microsoft.AspNetCore.Builder.IApplicationBuilder",
|
||||
"Static": true,
|
||||
"Extension": true,
|
||||
"Visibility": "Public",
|
||||
"GenericParameter": []
|
||||
},
|
||||
{
|
||||
"Kind": "Method",
|
||||
"Name": "UseBuilder",
|
||||
"Parameters": [
|
||||
{
|
||||
"Name": "app",
|
||||
"Type": "System.Action<System.Func<System.Func<System.Collections.Generic.IDictionary<System.String, System.Object>, System.Threading.Tasks.Task>, System.Func<System.Collections.Generic.IDictionary<System.String, System.Object>, System.Threading.Tasks.Task>>>"
|
||||
},
|
||||
{
|
||||
"Name": "serviceProvider",
|
||||
"Type": "System.IServiceProvider"
|
||||
}
|
||||
],
|
||||
"ReturnType": "Microsoft.AspNetCore.Builder.IApplicationBuilder",
|
||||
"Static": true,
|
||||
"Extension": true,
|
||||
"Visibility": "Public",
|
||||
"GenericParameter": []
|
||||
},
|
||||
{
|
||||
"Kind": "Method",
|
||||
"Name": "UseBuilder",
|
||||
"Parameters": [
|
||||
{
|
||||
"Name": "app",
|
||||
"Type": "System.Action<System.Func<System.Func<System.Collections.Generic.IDictionary<System.String, System.Object>, System.Threading.Tasks.Task>, System.Func<System.Collections.Generic.IDictionary<System.String, System.Object>, System.Threading.Tasks.Task>>>"
|
||||
},
|
||||
{
|
||||
"Name": "pipeline",
|
||||
"Type": "System.Action<Microsoft.AspNetCore.Builder.IApplicationBuilder>"
|
||||
}
|
||||
],
|
||||
"ReturnType": "System.Action<System.Func<System.Func<System.Collections.Generic.IDictionary<System.String, System.Object>, System.Threading.Tasks.Task>, System.Func<System.Collections.Generic.IDictionary<System.String, System.Object>, System.Threading.Tasks.Task>>>",
|
||||
"Static": true,
|
||||
"Extension": true,
|
||||
"Visibility": "Public",
|
||||
"GenericParameter": []
|
||||
},
|
||||
{
|
||||
"Kind": "Method",
|
||||
"Name": "UseBuilder",
|
||||
"Parameters": [
|
||||
{
|
||||
"Name": "app",
|
||||
"Type": "System.Action<System.Func<System.Func<System.Collections.Generic.IDictionary<System.String, System.Object>, System.Threading.Tasks.Task>, System.Func<System.Collections.Generic.IDictionary<System.String, System.Object>, System.Threading.Tasks.Task>>>"
|
||||
},
|
||||
{
|
||||
"Name": "pipeline",
|
||||
"Type": "System.Action<Microsoft.AspNetCore.Builder.IApplicationBuilder>"
|
||||
},
|
||||
{
|
||||
"Name": "serviceProvider",
|
||||
"Type": "System.IServiceProvider"
|
||||
}
|
||||
],
|
||||
"ReturnType": "System.Action<System.Func<System.Func<System.Collections.Generic.IDictionary<System.String, System.Object>, System.Threading.Tasks.Task>, System.Func<System.Collections.Generic.IDictionary<System.String, System.Object>, System.Threading.Tasks.Task>>>",
|
||||
"Static": true,
|
||||
"Extension": true,
|
||||
"Visibility": "Public",
|
||||
"GenericParameter": []
|
||||
}
|
||||
],
|
||||
"GenericParameters": []
|
||||
},
|
||||
{
|
||||
"Name": "Microsoft.AspNetCore.Owin.IOwinEnvironmentFeature",
|
||||
"Visibility": "Public",
|
||||
"Kind": "Interface",
|
||||
"Abstract": true,
|
||||
"ImplementedInterfaces": [],
|
||||
"Members": [
|
||||
{
|
||||
"Kind": "Method",
|
||||
"Name": "get_Environment",
|
||||
"Parameters": [],
|
||||
"ReturnType": "System.Collections.Generic.IDictionary<System.String, System.Object>",
|
||||
"GenericParameter": []
|
||||
},
|
||||
{
|
||||
"Kind": "Method",
|
||||
"Name": "set_Environment",
|
||||
"Parameters": [
|
||||
{
|
||||
"Name": "value",
|
||||
"Type": "System.Collections.Generic.IDictionary<System.String, System.Object>"
|
||||
}
|
||||
],
|
||||
"ReturnType": "System.Void",
|
||||
"GenericParameter": []
|
||||
}
|
||||
],
|
||||
"GenericParameters": []
|
||||
},
|
||||
{
|
||||
"Name": "Microsoft.AspNetCore.Owin.OwinEnvironment",
|
||||
"Visibility": "Public",
|
||||
"Kind": "Class",
|
||||
"ImplementedInterfaces": [
|
||||
"System.Collections.Generic.IDictionary<System.String, System.Object>"
|
||||
],
|
||||
"Members": [
|
||||
{
|
||||
"Kind": "Method",
|
||||
"Name": "get_FeatureMaps",
|
||||
"Parameters": [],
|
||||
"ReturnType": "System.Collections.Generic.IDictionary<System.String, Microsoft.AspNetCore.Owin.OwinEnvironment+FeatureMap>",
|
||||
"Visibility": "Public",
|
||||
"GenericParameter": []
|
||||
},
|
||||
{
|
||||
"Kind": "Constructor",
|
||||
"Name": ".ctor",
|
||||
"Parameters": [
|
||||
{
|
||||
"Name": "context",
|
||||
"Type": "Microsoft.AspNetCore.Http.HttpContext"
|
||||
}
|
||||
],
|
||||
"Visibility": "Public",
|
||||
"GenericParameter": []
|
||||
}
|
||||
],
|
||||
"GenericParameters": []
|
||||
},
|
||||
{
|
||||
"Name": "Microsoft.AspNetCore.Owin.OwinEnvironmentFeature",
|
||||
"Visibility": "Public",
|
||||
"Kind": "Class",
|
||||
"ImplementedInterfaces": [
|
||||
"Microsoft.AspNetCore.Owin.IOwinEnvironmentFeature"
|
||||
],
|
||||
"Members": [
|
||||
{
|
||||
"Kind": "Method",
|
||||
"Name": "get_Environment",
|
||||
"Parameters": [],
|
||||
"ReturnType": "System.Collections.Generic.IDictionary<System.String, System.Object>",
|
||||
"Sealed": true,
|
||||
"Virtual": true,
|
||||
"ImplementedInterface": "Microsoft.AspNetCore.Owin.IOwinEnvironmentFeature",
|
||||
"Visibility": "Public",
|
||||
"GenericParameter": []
|
||||
},
|
||||
{
|
||||
"Kind": "Method",
|
||||
"Name": "set_Environment",
|
||||
"Parameters": [
|
||||
{
|
||||
"Name": "value",
|
||||
"Type": "System.Collections.Generic.IDictionary<System.String, System.Object>"
|
||||
}
|
||||
],
|
||||
"ReturnType": "System.Void",
|
||||
"Sealed": true,
|
||||
"Virtual": true,
|
||||
"ImplementedInterface": "Microsoft.AspNetCore.Owin.IOwinEnvironmentFeature",
|
||||
"Visibility": "Public",
|
||||
"GenericParameter": []
|
||||
},
|
||||
{
|
||||
"Kind": "Constructor",
|
||||
"Name": ".ctor",
|
||||
"Parameters": [],
|
||||
"Visibility": "Public",
|
||||
"GenericParameter": []
|
||||
}
|
||||
],
|
||||
"GenericParameters": []
|
||||
},
|
||||
{
|
||||
"Name": "Microsoft.AspNetCore.Owin.OwinFeatureCollection",
|
||||
"Visibility": "Public",
|
||||
"Kind": "Class",
|
||||
"ImplementedInterfaces": [
|
||||
"Microsoft.AspNetCore.Http.Features.IFeatureCollection",
|
||||
"Microsoft.AspNetCore.Http.Features.IHttpRequestFeature",
|
||||
"Microsoft.AspNetCore.Http.Features.IHttpResponseFeature",
|
||||
"Microsoft.AspNetCore.Http.Features.IHttpConnectionFeature",
|
||||
"Microsoft.AspNetCore.Http.Features.IHttpSendFileFeature",
|
||||
"Microsoft.AspNetCore.Http.Features.ITlsConnectionFeature",
|
||||
"Microsoft.AspNetCore.Http.Features.IHttpRequestIdentifierFeature",
|
||||
"Microsoft.AspNetCore.Http.Features.IHttpRequestLifetimeFeature",
|
||||
"Microsoft.AspNetCore.Http.Features.Authentication.IHttpAuthenticationFeature",
|
||||
"Microsoft.AspNetCore.Http.Features.IHttpWebSocketFeature",
|
||||
"Microsoft.AspNetCore.Owin.IOwinEnvironmentFeature"
|
||||
],
|
||||
"Members": [
|
||||
{
|
||||
"Kind": "Method",
|
||||
"Name": "get_Environment",
|
||||
"Parameters": [],
|
||||
"ReturnType": "System.Collections.Generic.IDictionary<System.String, System.Object>",
|
||||
"Sealed": true,
|
||||
"Virtual": true,
|
||||
"ImplementedInterface": "Microsoft.AspNetCore.Owin.IOwinEnvironmentFeature",
|
||||
"Visibility": "Public",
|
||||
"GenericParameter": []
|
||||
},
|
||||
{
|
||||
"Kind": "Method",
|
||||
"Name": "set_Environment",
|
||||
"Parameters": [
|
||||
{
|
||||
"Name": "value",
|
||||
"Type": "System.Collections.Generic.IDictionary<System.String, System.Object>"
|
||||
}
|
||||
],
|
||||
"ReturnType": "System.Void",
|
||||
"Sealed": true,
|
||||
"Virtual": true,
|
||||
"ImplementedInterface": "Microsoft.AspNetCore.Owin.IOwinEnvironmentFeature",
|
||||
"Visibility": "Public",
|
||||
"GenericParameter": []
|
||||
},
|
||||
{
|
||||
"Kind": "Method",
|
||||
"Name": "get_SupportsWebSockets",
|
||||
"Parameters": [],
|
||||
"ReturnType": "System.Boolean",
|
||||
"Visibility": "Public",
|
||||
"GenericParameter": []
|
||||
},
|
||||
{
|
||||
"Kind": "Method",
|
||||
"Name": "set_SupportsWebSockets",
|
||||
"Parameters": [
|
||||
{
|
||||
"Name": "value",
|
||||
"Type": "System.Boolean"
|
||||
}
|
||||
],
|
||||
"ReturnType": "System.Void",
|
||||
"Visibility": "Public",
|
||||
"GenericParameter": []
|
||||
},
|
||||
{
|
||||
"Kind": "Method",
|
||||
"Name": "get_Revision",
|
||||
"Parameters": [],
|
||||
"ReturnType": "System.Int32",
|
||||
"Sealed": true,
|
||||
"Virtual": true,
|
||||
"ImplementedInterface": "Microsoft.AspNetCore.Http.Features.IFeatureCollection",
|
||||
"Visibility": "Public",
|
||||
"GenericParameter": []
|
||||
},
|
||||
{
|
||||
"Kind": "Method",
|
||||
"Name": "get_IsReadOnly",
|
||||
"Parameters": [],
|
||||
"ReturnType": "System.Boolean",
|
||||
"Sealed": true,
|
||||
"Virtual": true,
|
||||
"ImplementedInterface": "Microsoft.AspNetCore.Http.Features.IFeatureCollection",
|
||||
"Visibility": "Public",
|
||||
"GenericParameter": []
|
||||
},
|
||||
{
|
||||
"Kind": "Method",
|
||||
"Name": "get_Item",
|
||||
"Parameters": [
|
||||
{
|
||||
"Name": "key",
|
||||
"Type": "System.Type"
|
||||
}
|
||||
],
|
||||
"ReturnType": "System.Object",
|
||||
"Sealed": true,
|
||||
"Virtual": true,
|
||||
"ImplementedInterface": "Microsoft.AspNetCore.Http.Features.IFeatureCollection",
|
||||
"Visibility": "Public",
|
||||
"GenericParameter": []
|
||||
},
|
||||
{
|
||||
"Kind": "Method",
|
||||
"Name": "set_Item",
|
||||
"Parameters": [
|
||||
{
|
||||
"Name": "key",
|
||||
"Type": "System.Type"
|
||||
},
|
||||
{
|
||||
"Name": "value",
|
||||
"Type": "System.Object"
|
||||
}
|
||||
],
|
||||
"ReturnType": "System.Void",
|
||||
"Sealed": true,
|
||||
"Virtual": true,
|
||||
"ImplementedInterface": "Microsoft.AspNetCore.Http.Features.IFeatureCollection",
|
||||
"Visibility": "Public",
|
||||
"GenericParameter": []
|
||||
},
|
||||
{
|
||||
"Kind": "Method",
|
||||
"Name": "Get",
|
||||
"Parameters": [
|
||||
{
|
||||
"Name": "key",
|
||||
"Type": "System.Type"
|
||||
}
|
||||
],
|
||||
"ReturnType": "System.Object",
|
||||
"Visibility": "Public",
|
||||
"GenericParameter": []
|
||||
},
|
||||
{
|
||||
"Kind": "Method",
|
||||
"Name": "Set",
|
||||
"Parameters": [
|
||||
{
|
||||
"Name": "key",
|
||||
"Type": "System.Type"
|
||||
},
|
||||
{
|
||||
"Name": "value",
|
||||
"Type": "System.Object"
|
||||
}
|
||||
],
|
||||
"ReturnType": "System.Void",
|
||||
"Visibility": "Public",
|
||||
"GenericParameter": []
|
||||
},
|
||||
{
|
||||
"Kind": "Method",
|
||||
"Name": "Get<T0>",
|
||||
"Parameters": [],
|
||||
"ReturnType": "T0",
|
||||
"Sealed": true,
|
||||
"Virtual": true,
|
||||
"ImplementedInterface": "Microsoft.AspNetCore.Http.Features.IFeatureCollection",
|
||||
"Visibility": "Public",
|
||||
"GenericParameter": [
|
||||
{
|
||||
"ParameterName": "TFeature",
|
||||
"ParameterPosition": 0,
|
||||
"BaseTypeOrInterfaces": []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"Kind": "Method",
|
||||
"Name": "Set<T0>",
|
||||
"Parameters": [
|
||||
{
|
||||
"Name": "instance",
|
||||
"Type": "T0"
|
||||
}
|
||||
],
|
||||
"ReturnType": "System.Void",
|
||||
"Sealed": true,
|
||||
"Virtual": true,
|
||||
"ImplementedInterface": "Microsoft.AspNetCore.Http.Features.IFeatureCollection",
|
||||
"Visibility": "Public",
|
||||
"GenericParameter": [
|
||||
{
|
||||
"ParameterName": "TFeature",
|
||||
"ParameterPosition": 0,
|
||||
"BaseTypeOrInterfaces": []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"Kind": "Method",
|
||||
"Name": "GetEnumerator",
|
||||
"Parameters": [],
|
||||
"ReturnType": "System.Collections.Generic.IEnumerator<System.Collections.Generic.KeyValuePair<System.Type, System.Object>>",
|
||||
"Sealed": true,
|
||||
"Virtual": true,
|
||||
"ImplementedInterface": "System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<System.Type, System.Object>>",
|
||||
"Visibility": "Public",
|
||||
"GenericParameter": []
|
||||
},
|
||||
{
|
||||
"Kind": "Method",
|
||||
"Name": "Dispose",
|
||||
"Parameters": [],
|
||||
"ReturnType": "System.Void",
|
||||
"Visibility": "Public",
|
||||
"GenericParameter": []
|
||||
},
|
||||
{
|
||||
"Kind": "Constructor",
|
||||
"Name": ".ctor",
|
||||
"Parameters": [
|
||||
{
|
||||
"Name": "environment",
|
||||
"Type": "System.Collections.Generic.IDictionary<System.String, System.Object>"
|
||||
}
|
||||
],
|
||||
"Visibility": "Public",
|
||||
"GenericParameter": []
|
||||
}
|
||||
],
|
||||
"GenericParameters": []
|
||||
},
|
||||
{
|
||||
"Name": "Microsoft.AspNetCore.Owin.OwinWebSocketAcceptAdapter",
|
||||
"Visibility": "Public",
|
||||
"Kind": "Class",
|
||||
"ImplementedInterfaces": [],
|
||||
"Members": [
|
||||
{
|
||||
"Kind": "Method",
|
||||
"Name": "AdaptWebSockets",
|
||||
"Parameters": [
|
||||
{
|
||||
"Name": "next",
|
||||
"Type": "System.Func<System.Collections.Generic.IDictionary<System.String, System.Object>, System.Threading.Tasks.Task>"
|
||||
}
|
||||
],
|
||||
"ReturnType": "System.Func<System.Collections.Generic.IDictionary<System.String, System.Object>, System.Threading.Tasks.Task>",
|
||||
"Static": true,
|
||||
"Visibility": "Public",
|
||||
"GenericParameter": []
|
||||
}
|
||||
],
|
||||
"GenericParameters": []
|
||||
},
|
||||
{
|
||||
"Name": "Microsoft.AspNetCore.Owin.OwinWebSocketAcceptContext",
|
||||
"Visibility": "Public",
|
||||
"Kind": "Class",
|
||||
"BaseType": "Microsoft.AspNetCore.Http.WebSocketAcceptContext",
|
||||
"ImplementedInterfaces": [],
|
||||
"Members": [
|
||||
{
|
||||
"Kind": "Method",
|
||||
"Name": "get_SubProtocol",
|
||||
"Parameters": [],
|
||||
"ReturnType": "System.String",
|
||||
"Virtual": true,
|
||||
"Override": true,
|
||||
"Visibility": "Public",
|
||||
"GenericParameter": []
|
||||
},
|
||||
{
|
||||
"Kind": "Method",
|
||||
"Name": "set_SubProtocol",
|
||||
"Parameters": [
|
||||
{
|
||||
"Name": "value",
|
||||
"Type": "System.String"
|
||||
}
|
||||
],
|
||||
"ReturnType": "System.Void",
|
||||
"Virtual": true,
|
||||
"Override": true,
|
||||
"Visibility": "Public",
|
||||
"GenericParameter": []
|
||||
},
|
||||
{
|
||||
"Kind": "Method",
|
||||
"Name": "get_Options",
|
||||
"Parameters": [],
|
||||
"ReturnType": "System.Collections.Generic.IDictionary<System.String, System.Object>",
|
||||
"Visibility": "Public",
|
||||
"GenericParameter": []
|
||||
},
|
||||
{
|
||||
"Kind": "Constructor",
|
||||
"Name": ".ctor",
|
||||
"Parameters": [],
|
||||
"Visibility": "Public",
|
||||
"GenericParameter": []
|
||||
},
|
||||
{
|
||||
"Kind": "Constructor",
|
||||
"Name": ".ctor",
|
||||
"Parameters": [
|
||||
{
|
||||
"Name": "options",
|
||||
"Type": "System.Collections.Generic.IDictionary<System.String, System.Object>"
|
||||
}
|
||||
],
|
||||
"Visibility": "Public",
|
||||
"GenericParameter": []
|
||||
}
|
||||
],
|
||||
"GenericParameters": []
|
||||
},
|
||||
{
|
||||
"Name": "Microsoft.AspNetCore.Owin.OwinWebSocketAdapter",
|
||||
"Visibility": "Public",
|
||||
"Kind": "Class",
|
||||
"BaseType": "System.Net.WebSockets.WebSocket",
|
||||
"ImplementedInterfaces": [],
|
||||
"Members": [
|
||||
{
|
||||
"Kind": "Method",
|
||||
"Name": "get_CloseStatus",
|
||||
"Parameters": [],
|
||||
"ReturnType": "System.Nullable<System.Net.WebSockets.WebSocketCloseStatus>",
|
||||
"Virtual": true,
|
||||
"Override": true,
|
||||
"Visibility": "Public",
|
||||
"GenericParameter": []
|
||||
},
|
||||
{
|
||||
"Kind": "Method",
|
||||
"Name": "get_CloseStatusDescription",
|
||||
"Parameters": [],
|
||||
"ReturnType": "System.String",
|
||||
"Virtual": true,
|
||||
"Override": true,
|
||||
"Visibility": "Public",
|
||||
"GenericParameter": []
|
||||
},
|
||||
{
|
||||
"Kind": "Method",
|
||||
"Name": "get_SubProtocol",
|
||||
"Parameters": [],
|
||||
"ReturnType": "System.String",
|
||||
"Virtual": true,
|
||||
"Override": true,
|
||||
"Visibility": "Public",
|
||||
"GenericParameter": []
|
||||
},
|
||||
{
|
||||
"Kind": "Method",
|
||||
"Name": "get_State",
|
||||
"Parameters": [],
|
||||
"ReturnType": "System.Net.WebSockets.WebSocketState",
|
||||
"Virtual": true,
|
||||
"Override": true,
|
||||
"Visibility": "Public",
|
||||
"GenericParameter": []
|
||||
},
|
||||
{
|
||||
"Kind": "Method",
|
||||
"Name": "ReceiveAsync",
|
||||
"Parameters": [
|
||||
{
|
||||
"Name": "buffer",
|
||||
"Type": "System.ArraySegment<System.Byte>"
|
||||
},
|
||||
{
|
||||
"Name": "cancellationToken",
|
||||
"Type": "System.Threading.CancellationToken"
|
||||
}
|
||||
],
|
||||
"ReturnType": "System.Threading.Tasks.Task<System.Net.WebSockets.WebSocketReceiveResult>",
|
||||
"Virtual": true,
|
||||
"Override": true,
|
||||
"Visibility": "Public",
|
||||
"GenericParameter": []
|
||||
},
|
||||
{
|
||||
"Kind": "Method",
|
||||
"Name": "SendAsync",
|
||||
"Parameters": [
|
||||
{
|
||||
"Name": "buffer",
|
||||
"Type": "System.ArraySegment<System.Byte>"
|
||||
},
|
||||
{
|
||||
"Name": "messageType",
|
||||
"Type": "System.Net.WebSockets.WebSocketMessageType"
|
||||
},
|
||||
{
|
||||
"Name": "endOfMessage",
|
||||
"Type": "System.Boolean"
|
||||
},
|
||||
{
|
||||
"Name": "cancellationToken",
|
||||
"Type": "System.Threading.CancellationToken"
|
||||
}
|
||||
],
|
||||
"ReturnType": "System.Threading.Tasks.Task",
|
||||
"Virtual": true,
|
||||
"Override": true,
|
||||
"Visibility": "Public",
|
||||
"GenericParameter": []
|
||||
},
|
||||
{
|
||||
"Kind": "Method",
|
||||
"Name": "CloseAsync",
|
||||
"Parameters": [
|
||||
{
|
||||
"Name": "closeStatus",
|
||||
"Type": "System.Net.WebSockets.WebSocketCloseStatus"
|
||||
},
|
||||
{
|
||||
"Name": "statusDescription",
|
||||
"Type": "System.String"
|
||||
},
|
||||
{
|
||||
"Name": "cancellationToken",
|
||||
"Type": "System.Threading.CancellationToken"
|
||||
}
|
||||
],
|
||||
"ReturnType": "System.Threading.Tasks.Task",
|
||||
"Virtual": true,
|
||||
"Override": true,
|
||||
"Visibility": "Public",
|
||||
"GenericParameter": []
|
||||
},
|
||||
{
|
||||
"Kind": "Method",
|
||||
"Name": "CloseOutputAsync",
|
||||
"Parameters": [
|
||||
{
|
||||
"Name": "closeStatus",
|
||||
"Type": "System.Net.WebSockets.WebSocketCloseStatus"
|
||||
},
|
||||
{
|
||||
"Name": "statusDescription",
|
||||
"Type": "System.String"
|
||||
},
|
||||
{
|
||||
"Name": "cancellationToken",
|
||||
"Type": "System.Threading.CancellationToken"
|
||||
}
|
||||
],
|
||||
"ReturnType": "System.Threading.Tasks.Task",
|
||||
"Virtual": true,
|
||||
"Override": true,
|
||||
"Visibility": "Public",
|
||||
"GenericParameter": []
|
||||
},
|
||||
{
|
||||
"Kind": "Method",
|
||||
"Name": "Abort",
|
||||
"Parameters": [],
|
||||
"ReturnType": "System.Void",
|
||||
"Virtual": true,
|
||||
"Override": true,
|
||||
"Visibility": "Public",
|
||||
"GenericParameter": []
|
||||
},
|
||||
{
|
||||
"Kind": "Method",
|
||||
"Name": "Dispose",
|
||||
"Parameters": [],
|
||||
"ReturnType": "System.Void",
|
||||
"Virtual": true,
|
||||
"Override": true,
|
||||
"ImplementedInterface": "System.IDisposable",
|
||||
"Visibility": "Public",
|
||||
"GenericParameter": []
|
||||
},
|
||||
{
|
||||
"Kind": "Constructor",
|
||||
"Name": ".ctor",
|
||||
"Parameters": [
|
||||
{
|
||||
"Name": "websocketContext",
|
||||
"Type": "System.Collections.Generic.IDictionary<System.String, System.Object>"
|
||||
},
|
||||
{
|
||||
"Name": "subProtocol",
|
||||
"Type": "System.String"
|
||||
}
|
||||
],
|
||||
"Visibility": "Public",
|
||||
"GenericParameter": []
|
||||
}
|
||||
],
|
||||
"GenericParameters": []
|
||||
},
|
||||
{
|
||||
"Name": "Microsoft.AspNetCore.Owin.WebSocketAcceptAdapter",
|
||||
"Visibility": "Public",
|
||||
"Kind": "Class",
|
||||
"ImplementedInterfaces": [],
|
||||
"Members": [
|
||||
{
|
||||
"Kind": "Method",
|
||||
"Name": "AdaptWebSockets",
|
||||
"Parameters": [
|
||||
{
|
||||
"Name": "next",
|
||||
"Type": "System.Func<System.Collections.Generic.IDictionary<System.String, System.Object>, System.Threading.Tasks.Task>"
|
||||
}
|
||||
],
|
||||
"ReturnType": "System.Func<System.Collections.Generic.IDictionary<System.String, System.Object>, System.Threading.Tasks.Task>",
|
||||
"Static": true,
|
||||
"Visibility": "Public",
|
||||
"GenericParameter": []
|
||||
},
|
||||
{
|
||||
"Kind": "Constructor",
|
||||
"Name": ".ctor",
|
||||
"Parameters": [
|
||||
{
|
||||
"Name": "env",
|
||||
"Type": "System.Collections.Generic.IDictionary<System.String, System.Object>"
|
||||
},
|
||||
{
|
||||
"Name": "accept",
|
||||
"Type": "System.Func<Microsoft.AspNetCore.Http.WebSocketAcceptContext, System.Threading.Tasks.Task<System.Net.WebSockets.WebSocket>>"
|
||||
}
|
||||
],
|
||||
"Visibility": "Public",
|
||||
"GenericParameter": []
|
||||
}
|
||||
],
|
||||
"GenericParameters": []
|
||||
},
|
||||
{
|
||||
"Name": "Microsoft.AspNetCore.Owin.WebSocketAdapter",
|
||||
"Visibility": "Public",
|
||||
"Kind": "Class",
|
||||
"ImplementedInterfaces": [],
|
||||
"Members": [],
|
||||
"GenericParameters": []
|
||||
},
|
||||
{
|
||||
"Name": "Microsoft.AspNetCore.Owin.OwinEnvironment+FeatureMap",
|
||||
"Visibility": "Public",
|
||||
"Kind": "Class",
|
||||
"ImplementedInterfaces": [],
|
||||
"Members": [
|
||||
{
|
||||
"Kind": "Method",
|
||||
"Name": "get_CanSet",
|
||||
"Parameters": [],
|
||||
"ReturnType": "System.Boolean",
|
||||
"Visibility": "Public",
|
||||
"GenericParameter": []
|
||||
},
|
||||
{
|
||||
"Kind": "Constructor",
|
||||
"Name": ".ctor",
|
||||
"Parameters": [
|
||||
{
|
||||
"Name": "featureInterface",
|
||||
"Type": "System.Type"
|
||||
},
|
||||
{
|
||||
"Name": "getter",
|
||||
"Type": "System.Func<System.Object, System.Object>"
|
||||
}
|
||||
],
|
||||
"Visibility": "Public",
|
||||
"GenericParameter": []
|
||||
},
|
||||
{
|
||||
"Kind": "Constructor",
|
||||
"Name": ".ctor",
|
||||
"Parameters": [
|
||||
{
|
||||
"Name": "featureInterface",
|
||||
"Type": "System.Type"
|
||||
},
|
||||
{
|
||||
"Name": "getter",
|
||||
"Type": "System.Func<System.Object, System.Object>"
|
||||
},
|
||||
{
|
||||
"Name": "defaultFactory",
|
||||
"Type": "System.Func<System.Object>"
|
||||
}
|
||||
],
|
||||
"Visibility": "Public",
|
||||
"GenericParameter": []
|
||||
},
|
||||
{
|
||||
"Kind": "Constructor",
|
||||
"Name": ".ctor",
|
||||
"Parameters": [
|
||||
{
|
||||
"Name": "featureInterface",
|
||||
"Type": "System.Type"
|
||||
},
|
||||
{
|
||||
"Name": "getter",
|
||||
"Type": "System.Func<System.Object, System.Object>"
|
||||
},
|
||||
{
|
||||
"Name": "setter",
|
||||
"Type": "System.Action<System.Object, System.Object>"
|
||||
}
|
||||
],
|
||||
"Visibility": "Public",
|
||||
"GenericParameter": []
|
||||
},
|
||||
{
|
||||
"Kind": "Constructor",
|
||||
"Name": ".ctor",
|
||||
"Parameters": [
|
||||
{
|
||||
"Name": "featureInterface",
|
||||
"Type": "System.Type"
|
||||
},
|
||||
{
|
||||
"Name": "getter",
|
||||
"Type": "System.Func<System.Object, System.Object>"
|
||||
},
|
||||
{
|
||||
"Name": "defaultFactory",
|
||||
"Type": "System.Func<System.Object>"
|
||||
},
|
||||
{
|
||||
"Name": "setter",
|
||||
"Type": "System.Action<System.Object, System.Object>"
|
||||
}
|
||||
],
|
||||
"Visibility": "Public",
|
||||
"GenericParameter": []
|
||||
},
|
||||
{
|
||||
"Kind": "Constructor",
|
||||
"Name": ".ctor",
|
||||
"Parameters": [
|
||||
{
|
||||
"Name": "featureInterface",
|
||||
"Type": "System.Type"
|
||||
},
|
||||
{
|
||||
"Name": "getter",
|
||||
"Type": "System.Func<System.Object, System.Object>"
|
||||
},
|
||||
{
|
||||
"Name": "defaultFactory",
|
||||
"Type": "System.Func<System.Object>"
|
||||
},
|
||||
{
|
||||
"Name": "setter",
|
||||
"Type": "System.Action<System.Object, System.Object>"
|
||||
},
|
||||
{
|
||||
"Name": "featureFactory",
|
||||
"Type": "System.Func<System.Object>"
|
||||
}
|
||||
],
|
||||
"Visibility": "Public",
|
||||
"GenericParameter": []
|
||||
}
|
||||
],
|
||||
"GenericParameters": []
|
||||
},
|
||||
{
|
||||
"Name": "Microsoft.AspNetCore.Owin.OwinEnvironment+FeatureMap<T0>",
|
||||
"Visibility": "Public",
|
||||
"Kind": "Class",
|
||||
"BaseType": "Microsoft.AspNetCore.Owin.OwinEnvironment+FeatureMap",
|
||||
"ImplementedInterfaces": [],
|
||||
"Members": [
|
||||
{
|
||||
"Kind": "Constructor",
|
||||
"Name": ".ctor",
|
||||
"Parameters": [
|
||||
{
|
||||
"Name": "getter",
|
||||
"Type": "System.Func<T0, System.Object>"
|
||||
}
|
||||
],
|
||||
"Visibility": "Public",
|
||||
"GenericParameter": []
|
||||
},
|
||||
{
|
||||
"Kind": "Constructor",
|
||||
"Name": ".ctor",
|
||||
"Parameters": [
|
||||
{
|
||||
"Name": "getter",
|
||||
"Type": "System.Func<T0, System.Object>"
|
||||
},
|
||||
{
|
||||
"Name": "defaultFactory",
|
||||
"Type": "System.Func<System.Object>"
|
||||
}
|
||||
],
|
||||
"Visibility": "Public",
|
||||
"GenericParameter": []
|
||||
},
|
||||
{
|
||||
"Kind": "Constructor",
|
||||
"Name": ".ctor",
|
||||
"Parameters": [
|
||||
{
|
||||
"Name": "getter",
|
||||
"Type": "System.Func<T0, System.Object>"
|
||||
},
|
||||
{
|
||||
"Name": "setter",
|
||||
"Type": "System.Action<T0, System.Object>"
|
||||
}
|
||||
],
|
||||
"Visibility": "Public",
|
||||
"GenericParameter": []
|
||||
},
|
||||
{
|
||||
"Kind": "Constructor",
|
||||
"Name": ".ctor",
|
||||
"Parameters": [
|
||||
{
|
||||
"Name": "getter",
|
||||
"Type": "System.Func<T0, System.Object>"
|
||||
},
|
||||
{
|
||||
"Name": "defaultFactory",
|
||||
"Type": "System.Func<System.Object>"
|
||||
},
|
||||
{
|
||||
"Name": "setter",
|
||||
"Type": "System.Action<T0, System.Object>"
|
||||
}
|
||||
],
|
||||
"Visibility": "Public",
|
||||
"GenericParameter": []
|
||||
},
|
||||
{
|
||||
"Kind": "Constructor",
|
||||
"Name": ".ctor",
|
||||
"Parameters": [
|
||||
{
|
||||
"Name": "getter",
|
||||
"Type": "System.Func<T0, System.Object>"
|
||||
},
|
||||
{
|
||||
"Name": "defaultFactory",
|
||||
"Type": "System.Func<System.Object>"
|
||||
},
|
||||
{
|
||||
"Name": "setter",
|
||||
"Type": "System.Action<T0, System.Object>"
|
||||
},
|
||||
{
|
||||
"Name": "featureFactory",
|
||||
"Type": "System.Func<T0>"
|
||||
}
|
||||
],
|
||||
"Visibility": "Public",
|
||||
"GenericParameter": []
|
||||
}
|
||||
],
|
||||
"GenericParameters": [
|
||||
{
|
||||
"ParameterName": "TFeature",
|
||||
"ParameterPosition": 0,
|
||||
"BaseTypeOrInterfaces": []
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -201,71 +201,7 @@ namespace Microsoft.AspNetCore.WebUtilities
|
|||
|
||||
return await _inner.ReadAsync(buffer, offset, count, cancellationToken);
|
||||
}
|
||||
#if NET46
|
||||
public override IAsyncResult BeginWrite(byte[] buffer, int offset, int count, AsyncCallback callback, object state)
|
||||
{
|
||||
return _inner.BeginWrite(buffer, offset, count, callback, state);
|
||||
}
|
||||
|
||||
public override void EndWrite(IAsyncResult asyncResult)
|
||||
{
|
||||
_inner.EndWrite(asyncResult);
|
||||
}
|
||||
|
||||
// We only anticipate using ReadAsync
|
||||
public override IAsyncResult BeginRead(byte[] buffer, int offset, int count, AsyncCallback callback, object state)
|
||||
{
|
||||
ValidateBuffer(buffer, offset, count);
|
||||
|
||||
// Drain buffer
|
||||
if (_bufferCount > 0)
|
||||
{
|
||||
int toCopy = Math.Min(_bufferCount, count);
|
||||
Buffer.BlockCopy(_buffer, _bufferOffset, buffer, offset, toCopy);
|
||||
_bufferOffset += toCopy;
|
||||
_bufferCount -= toCopy;
|
||||
|
||||
TaskCompletionSource<int> tcs = new TaskCompletionSource<int>(state);
|
||||
tcs.TrySetResult(toCopy);
|
||||
if (callback != null)
|
||||
{
|
||||
// Offload callbacks to avoid stack dives on sync completions.
|
||||
var ignored = Task.Run(() =>
|
||||
{
|
||||
try
|
||||
{
|
||||
callback(tcs.Task);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
// Suppress exceptions on background threads.
|
||||
}
|
||||
});
|
||||
}
|
||||
return tcs.Task;
|
||||
}
|
||||
|
||||
return _inner.BeginRead(buffer, offset, count, callback, state);
|
||||
}
|
||||
|
||||
public override int EndRead(IAsyncResult asyncResult)
|
||||
{
|
||||
if (asyncResult == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(asyncResult));
|
||||
}
|
||||
|
||||
Task<int> task = asyncResult as Task<int>;
|
||||
if (task != null)
|
||||
{
|
||||
return task.GetAwaiter().GetResult();
|
||||
}
|
||||
return _inner.EndRead(asyncResult);
|
||||
}
|
||||
#elif NETSTANDARD1_3
|
||||
#else
|
||||
#error Target frameworks need to be updated.
|
||||
#endif
|
||||
public bool EnsureBuffered()
|
||||
{
|
||||
if (_bufferCount > 0)
|
||||
|
|
|
|||
|
|
@ -250,68 +250,7 @@ namespace Microsoft.AspNetCore.WebUtilities
|
|||
|
||||
return read;
|
||||
}
|
||||
#if NET46
|
||||
public override IAsyncResult BeginRead(byte[] buffer, int offset, int count, AsyncCallback callback, object state)
|
||||
{
|
||||
ThrowIfDisposed();
|
||||
var tcs = new TaskCompletionSource<int>(state);
|
||||
BeginRead(buffer, offset, count, callback, tcs);
|
||||
return tcs.Task;
|
||||
}
|
||||
|
||||
private async void BeginRead(byte[] buffer, int offset, int count, AsyncCallback callback, TaskCompletionSource<int> tcs)
|
||||
{
|
||||
try
|
||||
{
|
||||
var read = await ReadAsync(buffer, offset, count);
|
||||
tcs.TrySetResult(read);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
tcs.TrySetException(ex);
|
||||
}
|
||||
|
||||
if (callback != null)
|
||||
{
|
||||
// Offload callbacks to avoid stack dives on sync completions.
|
||||
var ignored = Task.Run(() =>
|
||||
{
|
||||
try
|
||||
{
|
||||
callback(tcs.Task);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
// Suppress exceptions on background threads.
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public override int EndRead(IAsyncResult asyncResult)
|
||||
{
|
||||
if (asyncResult == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(asyncResult));
|
||||
}
|
||||
|
||||
var task = (Task<int>)asyncResult;
|
||||
return task.GetAwaiter().GetResult();
|
||||
}
|
||||
|
||||
public override IAsyncResult BeginWrite(byte[] buffer, int offset, int count, AsyncCallback callback, object state)
|
||||
{
|
||||
throw new NotSupportedException();
|
||||
}
|
||||
|
||||
public override void EndWrite(IAsyncResult asyncResult)
|
||||
{
|
||||
throw new NotSupportedException();
|
||||
}
|
||||
#elif NETSTANDARD1_3
|
||||
#else
|
||||
#error Target frameworks need to be updated.
|
||||
#endif
|
||||
public override async Task<int> ReadAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
|
||||
{
|
||||
ThrowIfDisposed();
|
||||
|
|
|
|||
|
|
@ -108,16 +108,6 @@ namespace Microsoft.AspNetCore.WebUtilities
|
|||
}
|
||||
}
|
||||
|
||||
#if NET46
|
||||
public override void Close()
|
||||
{
|
||||
Dispose(true);
|
||||
}
|
||||
#elif NETSTANDARD1_3
|
||||
#else
|
||||
#error Target frameworks need to be updated.
|
||||
#endif
|
||||
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && _stream != null)
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
<PropertyGroup>
|
||||
<Description>ASP.NET Core utilities, such as for working with forms, multipart messages, and query strings.</Description>
|
||||
<TargetFrameworks>netstandard1.3;net46</TargetFrameworks>
|
||||
<TargetFramework>netcoreapp2.0</TargetFramework>
|
||||
<DefineConstants>$(DefineConstants);WebEncoders_In_WebUtilities</DefineConstants>
|
||||
<NoWarn>$(NoWarn);CS1591</NoWarn>
|
||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||
|
|
|
|||
|
|
@ -158,67 +158,7 @@ namespace Microsoft.AspNetCore.WebUtilities
|
|||
}
|
||||
return read;
|
||||
}
|
||||
#if NET46
|
||||
public override IAsyncResult BeginWrite(byte[] buffer, int offset, int size, AsyncCallback callback, object state)
|
||||
{
|
||||
throw new NotSupportedException();
|
||||
}
|
||||
|
||||
public override void EndWrite(IAsyncResult asyncResult)
|
||||
{
|
||||
throw new NotSupportedException();
|
||||
}
|
||||
|
||||
public override IAsyncResult BeginRead(byte[] buffer, int offset, int size, AsyncCallback callback, object state)
|
||||
{
|
||||
var tcs = new TaskCompletionSource<int>(state);
|
||||
InternalReadAsync(buffer, offset, size, callback, tcs);
|
||||
return tcs.Task;
|
||||
}
|
||||
|
||||
private async void InternalReadAsync(byte[] buffer, int offset, int size, AsyncCallback callback, TaskCompletionSource<int> tcs)
|
||||
{
|
||||
try
|
||||
{
|
||||
int read = await ReadAsync(buffer, offset, size);
|
||||
tcs.TrySetResult(read);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
tcs.TrySetException(ex);
|
||||
}
|
||||
|
||||
if (callback != null)
|
||||
{
|
||||
// Offload callbacks to avoid stack dives on sync completions.
|
||||
var ignored = Task.Run(() =>
|
||||
{
|
||||
try
|
||||
{
|
||||
callback(tcs.Task);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
// Suppress exceptions on background threads.
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public override int EndRead(IAsyncResult asyncResult)
|
||||
{
|
||||
if (asyncResult == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(asyncResult));
|
||||
}
|
||||
|
||||
var task = (Task<int>)asyncResult;
|
||||
return task.GetAwaiter().GetResult();
|
||||
}
|
||||
#elif NETSTANDARD1_3
|
||||
#else
|
||||
#error Target frameworks need to be updated.
|
||||
#endif
|
||||
public override int Read(byte[] buffer, int offset, int count)
|
||||
{
|
||||
if (_finished)
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
<PropertyGroup>
|
||||
<Description>HTTP header parser implementations.</Description>
|
||||
<TargetFramework>netstandard1.1</TargetFramework>
|
||||
<TargetFramework>netcoreapp2.0</TargetFramework>
|
||||
<NoWarn>$(NoWarn);CS1591</NoWarn>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||
|
|
|
|||
|
|
@ -2,8 +2,7 @@
|
|||
|
||||
<Import Project="..\..\build\common.props" />
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>netcoreapp2.0;net46</TargetFrameworks>
|
||||
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.0</TargetFrameworks>
|
||||
<TargetFramework>netcoreapp2.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\src\Microsoft.AspNetCore.Authentication.Core\Microsoft.AspNetCore.Authentication.Core.csproj" />
|
||||
|
|
|
|||
|
|
@ -3,8 +3,7 @@
|
|||
<Import Project="..\..\build\common.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>netcoreapp2.0;net46</TargetFrameworks>
|
||||
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.0</TargetFrameworks>
|
||||
<TargetFramework>netcoreapp2.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
|||
|
|
@ -3,8 +3,7 @@
|
|||
<Import Project="..\..\build\common.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>netcoreapp2.0;net46</TargetFrameworks>
|
||||
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.0</TargetFrameworks>
|
||||
<TargetFramework>netcoreapp2.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
|||
|
|
@ -3,8 +3,7 @@
|
|||
<Import Project="..\..\build\common.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>netcoreapp2.0;net46</TargetFrameworks>
|
||||
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.0</TargetFrameworks>
|
||||
<TargetFramework>netcoreapp2.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
|||
|
|
@ -36,40 +36,5 @@ namespace Microsoft.AspNetCore.Http
|
|||
var context = contextFactory.Create(new FeatureCollection());
|
||||
contextFactory.Dispose(context);
|
||||
}
|
||||
|
||||
#if NET46
|
||||
private static void DomainFunc()
|
||||
{
|
||||
var accessor = new HttpContextAccessor();
|
||||
Assert.Equal(null, accessor.HttpContext);
|
||||
accessor.HttpContext = new DefaultHttpContext();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ChangingAppDomainsDoesNotBreak()
|
||||
{
|
||||
// Arrange
|
||||
var accessor = new HttpContextAccessor();
|
||||
var contextFactory = new HttpContextFactory(new DefaultObjectPoolProvider(), Options.Create(new FormOptions()), accessor);
|
||||
var baseDirectory = AppDomain.CurrentDomain.BaseDirectory;
|
||||
var setupInfo = new AppDomainSetup
|
||||
{
|
||||
ApplicationBase = baseDirectory,
|
||||
ConfigurationFile = Path.Combine(baseDirectory, Path.GetFileNameWithoutExtension(GetType().Assembly.Location) + ".dll.config"),
|
||||
};
|
||||
var domain = AppDomain.CreateDomain("newDomain", null, setupInfo);
|
||||
|
||||
// Act
|
||||
var context = contextFactory.Create(new FeatureCollection());
|
||||
domain.DoCallBack(DomainFunc);
|
||||
AppDomain.Unload(domain);
|
||||
|
||||
// Assert
|
||||
Assert.True(ReferenceEquals(context, accessor.HttpContext));
|
||||
}
|
||||
#elif NETCOREAPP2_0
|
||||
#else
|
||||
#error Target framework needs to be updated
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
|
@ -3,8 +3,7 @@
|
|||
<Import Project="..\..\build\common.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>netcoreapp2.0;net46</TargetFrameworks>
|
||||
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.0</TargetFrameworks>
|
||||
<TargetFramework>netcoreapp2.0</TargetFramework>
|
||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>
|
||||
</PropertyGroup>
|
||||
|
|
|
|||
|
|
@ -3,8 +3,7 @@
|
|||
<Import Project="..\..\build\common.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>netcoreapp2.0;net46</TargetFrameworks>
|
||||
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.0</TargetFrameworks>
|
||||
<TargetFramework>netcoreapp2.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
|||
|
|
@ -293,13 +293,7 @@ namespace Microsoft.AspNetCore.WebUtilities
|
|||
|
||||
private static string GetCurrentDirectory()
|
||||
{
|
||||
#if NET46
|
||||
return AppDomain.CurrentDomain.BaseDirectory;
|
||||
#elif NETCOREAPP2_0
|
||||
return AppContext.BaseDirectory;
|
||||
#else
|
||||
#error Target framework needs to be updated
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -34,27 +34,6 @@ namespace Microsoft.AspNetCore.WebUtilities.Test
|
|||
Assert.Equal(expectedData, memoryStream.ToArray());
|
||||
}
|
||||
|
||||
#if NET46
|
||||
[Fact]
|
||||
public async Task DoesNotFlush_UnderlyingStream_OnClosingWriter()
|
||||
{
|
||||
// Arrange
|
||||
var stream = new TestMemoryStream();
|
||||
var writer = new HttpResponseStreamWriter(stream, Encoding.UTF8);
|
||||
|
||||
// Act
|
||||
await writer.WriteAsync("Hello");
|
||||
writer.Close();
|
||||
|
||||
// Assert
|
||||
Assert.Equal(0, stream.FlushCallCount);
|
||||
Assert.Equal(0, stream.FlushAsyncCallCount);
|
||||
}
|
||||
#elif NETCOREAPP2_0
|
||||
#else
|
||||
#error Target framework needs to be updated
|
||||
#endif
|
||||
|
||||
[Fact]
|
||||
public async Task DoesNotFlush_UnderlyingStream_OnDisposingWriter()
|
||||
{
|
||||
|
|
@ -71,26 +50,6 @@ namespace Microsoft.AspNetCore.WebUtilities.Test
|
|||
Assert.Equal(0, stream.FlushAsyncCallCount);
|
||||
}
|
||||
|
||||
#if NET46
|
||||
[Fact]
|
||||
public async Task DoesNotClose_UnderlyingStream_OnDisposingWriter()
|
||||
{
|
||||
// Arrange
|
||||
var stream = new TestMemoryStream();
|
||||
var writer = new HttpResponseStreamWriter(stream, Encoding.UTF8);
|
||||
|
||||
// Act
|
||||
await writer.WriteAsync("Hello");
|
||||
writer.Close();
|
||||
|
||||
// Assert
|
||||
Assert.Equal(0, stream.CloseCallCount);
|
||||
}
|
||||
#elif NETCOREAPP2_0
|
||||
#else
|
||||
#error Target framework needs to be updated
|
||||
#endif
|
||||
|
||||
[Fact]
|
||||
public async Task DoesNotDispose_UnderlyingStream_OnDisposingWriter()
|
||||
{
|
||||
|
|
@ -119,13 +78,7 @@ namespace Microsoft.AspNetCore.WebUtilities.Test
|
|||
await writer.WriteAsync(new string('a', byteLength));
|
||||
|
||||
// Act
|
||||
#if NET46
|
||||
writer.Close();
|
||||
#elif NETCOREAPP2_0
|
||||
writer.Dispose();
|
||||
#else
|
||||
#error Target framework needs to be updated
|
||||
#endif
|
||||
|
||||
// Assert
|
||||
Assert.Equal(0, stream.FlushCallCount);
|
||||
|
|
@ -345,13 +298,6 @@ namespace Microsoft.AspNetCore.WebUtilities.Test
|
|||
|
||||
[Theory]
|
||||
[InlineData("你好世界", "utf-16")]
|
||||
#if NET46
|
||||
// CoreCLR does not like shift_jis as an encoding.
|
||||
[InlineData("こんにちは世界", "shift_jis")]
|
||||
#elif NETCOREAPP2_0
|
||||
#else
|
||||
#error Target framework needs to be updated
|
||||
#endif
|
||||
[InlineData("హలో ప్రపంచ", "iso-8859-1")]
|
||||
[InlineData("வணக்கம் உலக", "utf-32")]
|
||||
public async Task WritesData_InExpectedEncoding(string data, string encodingName)
|
||||
|
|
@ -379,15 +325,6 @@ namespace Microsoft.AspNetCore.WebUtilities.Test
|
|||
[InlineData('你', 1023, "utf-16")]
|
||||
[InlineData('你', 1024, "utf-16")]
|
||||
[InlineData('你', 1050, "utf-16")]
|
||||
#if NET46
|
||||
// CoreCLR does not like shift_jis as an encoding.
|
||||
[InlineData('こ', 1023, "shift_jis")]
|
||||
[InlineData('こ', 1024, "shift_jis")]
|
||||
[InlineData('こ', 1050, "shift_jis")]
|
||||
#elif NETCOREAPP2_0
|
||||
#else
|
||||
#error Target framework needs to be updated
|
||||
#endif
|
||||
[InlineData('హ', 1023, "iso-8859-1")]
|
||||
[InlineData('హ', 1024, "iso-8859-1")]
|
||||
[InlineData('హ', 1050, "iso-8859-1")]
|
||||
|
|
@ -516,17 +453,6 @@ namespace Microsoft.AspNetCore.WebUtilities.Test
|
|||
return base.WriteAsync(buffer, offset, count, cancellationToken);
|
||||
}
|
||||
|
||||
#if NET46
|
||||
public override void Close()
|
||||
{
|
||||
CloseCallCount++;
|
||||
base.Close();
|
||||
}
|
||||
#elif NETCOREAPP2_0
|
||||
#else
|
||||
#error Target framework needs to be updated
|
||||
#endif
|
||||
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
DisposeCallCount++;
|
||||
|
|
|
|||
|
|
@ -3,8 +3,7 @@
|
|||
<Import Project="..\..\build\common.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>netcoreapp2.0;net46</TargetFrameworks>
|
||||
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.0</TargetFrameworks>
|
||||
<TargetFramework>netcoreapp2.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
|||
|
|
@ -3,8 +3,7 @@
|
|||
<Import Project="..\..\build\common.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>netcoreapp2.0;net46</TargetFrameworks>
|
||||
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.0</TargetFrameworks>
|
||||
<TargetFramework>netcoreapp2.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
|||
Loading…
Reference in New Issue