Prevent infinite loop in PipelineExtensions.PeekAsyncAwaited() (#1827).
This commit is contained in:
parent
e149852d62
commit
cb1d0f3956
|
|
@ -40,7 +40,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
|
|||
}
|
||||
finally
|
||||
{
|
||||
pipelineReader.Advance(result.Buffer.Start, result.Buffer.Start);
|
||||
pipelineReader.Advance(result.Buffer.Start, result.Buffer.IsEmpty
|
||||
? result.Buffer.End
|
||||
: result.Buffer.Start);
|
||||
}
|
||||
input = pipelineReader.ReadAsync();
|
||||
}
|
||||
|
|
@ -68,7 +70,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
|
|||
}
|
||||
finally
|
||||
{
|
||||
pipelineReader.Advance(result.Buffer.Start, result.Buffer.Start);
|
||||
pipelineReader.Advance(result.Buffer.Start, result.Buffer.IsEmpty
|
||||
? result.Buffer.End
|
||||
: result.Buffer.Start);
|
||||
}
|
||||
|
||||
readingTask = pipelineReader.ReadAsync();
|
||||
|
|
@ -325,4 +329,4 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
|
|||
return bytes;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue