Run http request on separate thread. (#545)

This commit is contained in:
Justin Kotalik 2018-01-23 14:56:47 -08:00 committed by GitHub
parent 10f0f7b2ee
commit 3d167c1e6c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 10 deletions

View File

@ -299,12 +299,12 @@
<application name="Active Server Pages" groupId="ASP" /> <application name="Active Server Pages" groupId="ASP" />
</applicationDependencies> </applicationDependencies>
<authentication> <authentication>
<anonymousAuthentication enabled="false" userName="" /> <anonymousAuthentication enabled="true" userName="" />
<basicAuthentication enabled="false" /> <basicAuthentication enabled="false" />
<clientCertificateMappingAuthentication enabled="false" /> <clientCertificateMappingAuthentication enabled="false" />
<digestAuthentication enabled="false" /> <digestAuthentication enabled="false" />
<iisClientCertificateMappingAuthentication enabled="false"></iisClientCertificateMappingAuthentication> <iisClientCertificateMappingAuthentication enabled="false"></iisClientCertificateMappingAuthentication>
<windowsAuthentication enabled="true"> <windowsAuthentication enabled="false">
<providers> <providers>
<add value="Negotiate" /> <add value="Negotiate" />
<add value="NTLM" /> <add value="NTLM" />

View File

@ -80,14 +80,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration
var context = server._iisContextFactory.CreateHttpContext(pInProcessHandler); var context = server._iisContextFactory.CreateHttpContext(pInProcessHandler);
var task = context.ProcessRequestAsync(); var task = Task.Run(() => context.ProcessRequestAsync());
// This should never fail
if (task.IsCompleted)
{
context.Dispose();
return ConvertRequestCompletionResults(task.Result);
}
task.ContinueWith((t, state) => CompleteRequest((IISHttpContext)state, t), context); task.ContinueWith((t, state) => CompleteRequest((IISHttpContext)state, t), context);