Fix race preventing handling of the last request sent over a connection

We need to attempt to consume start lines and headers even after
SocketInput.RemoteIntakeFin is set to true to ensure we don't close a
connection without giving the application a chance to respond to a request
sent immediately before the a FIN from the client.
This commit is contained in:
Stephen Halter 2016-03-17 23:01:42 -07:00
parent 84a68208d0
commit 792f3ad089
1 changed files with 12 additions and 0 deletions

View File

@ -37,8 +37,14 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Http
{
if (SocketInput.RemoteIntakeFin)
{
if (TakeStartLine(SocketInput))
{
break;
}
return;
}
await SocketInput;
}
@ -48,8 +54,14 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Http
{
if (SocketInput.RemoteIntakeFin)
{
if (TakeMessageHeaders(SocketInput, FrameRequestHeaders))
{
break;
}
return;
}
await SocketInput;
}