Merge branch 'benaadams/read-to-null-buffer' into release
This commit is contained in:
commit
85202b0174
|
|
@ -29,6 +29,7 @@ namespace Microsoft.AspNet.Server.Kestrel.Http
|
|||
private readonly object _onStartingSync = new Object();
|
||||
private readonly object _onCompletedSync = new Object();
|
||||
private readonly FrameRequestHeaders _requestHeaders = new FrameRequestHeaders();
|
||||
private readonly byte[] _nullBuffer = new byte[4096];
|
||||
private readonly FrameResponseHeaders _responseHeaders = new FrameResponseHeaders();
|
||||
|
||||
private List<KeyValuePair<Func<object, Task>, object>> _onStarting;
|
||||
|
|
@ -197,8 +198,10 @@ namespace Microsoft.AspNet.Server.Kestrel.Http
|
|||
|
||||
await ProduceEnd();
|
||||
|
||||
// Finish reading the request body in case the app did not.
|
||||
await RequestBody.CopyToAsync(Stream.Null);
|
||||
while (await RequestBody.ReadAsync(_nullBuffer, 0, _nullBuffer.Length) != 0)
|
||||
{
|
||||
// Finish reading the request body in case the app did not.
|
||||
}
|
||||
}
|
||||
|
||||
terminated = !_keepAlive;
|
||||
|
|
|
|||
Loading…
Reference in New Issue