PR comments
This commit is contained in:
parent
e32b51d6e6
commit
80e799d17c
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
<PropertyGroup>
|
||||
<Description>ASP.NET Core components for working with the IIS AspNetCoreModule.</Description>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
<TargetFrameworks>netstandard2.0;netcoreapp2.1</TargetFrameworks>
|
||||
<NoWarn>$(NoWarn);CS1591</NoWarn>
|
||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||
<PackageTags>aspnetcore;iis</PackageTags>
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration
|
|||
[DllImport(AspNetCoreModuleDll)]
|
||||
private static extern int http_get_server_variable(
|
||||
IntPtr pInProcessHandler,
|
||||
[MarshalAs(UnmanagedType.AnsiBStr)] string variableName,
|
||||
[MarshalAs(UnmanagedType.LPStr)] string variableName,
|
||||
[MarshalAs(UnmanagedType.BStr)] out string value);
|
||||
|
||||
[DllImport(AspNetCoreModuleDll)]
|
||||
|
|
|
|||
|
|
@ -144,16 +144,25 @@ namespace Microsoft.AspNetCore.Server.IISIntegration
|
|||
var server = (IISHttpServer)GCHandle.FromIntPtr(pvRequestContext).Target;
|
||||
Interlocked.Increment(ref server._outstandingRequests);
|
||||
|
||||
_ = Task.Run(
|
||||
async () => {
|
||||
var context = server._iisContextFactory.CreateHttpContext(pInProcessHandler);
|
||||
var result = await context.ProcessRequestAsync();;
|
||||
CompleteRequest(context, result);
|
||||
});
|
||||
|
||||
#if NETCOREAPP2_1
|
||||
ThreadPool.QueueUserWorkItem<(IISHttpServer, IntPtr)>(
|
||||
state => _ = HandleRequest(state.Item1, state.Item2),
|
||||
(server, pInProcessHandler),
|
||||
preferLocal: false);
|
||||
#else
|
||||
ThreadPool.QueueUserWorkItem(
|
||||
state => _ = HandleRequest(server, pInProcessHandler));
|
||||
#endif
|
||||
return NativeMethods.REQUEST_NOTIFICATION_STATUS.RQ_NOTIFICATION_PENDING;
|
||||
}
|
||||
|
||||
private static async Task HandleRequest(IISHttpServer server, IntPtr handler)
|
||||
{
|
||||
var context = server._iisContextFactory.CreateHttpContext(handler);
|
||||
var result = await context.ProcessRequestAsync();
|
||||
CompleteRequest(context, result);
|
||||
}
|
||||
|
||||
private static bool HandleShutdown(IntPtr pvRequestContext)
|
||||
{
|
||||
var server = (IISHttpServer)GCHandle.FromIntPtr(pvRequestContext).Target;
|
||||
|
|
|
|||
Loading…
Reference in New Issue