Merge branch 'release' into dev
This commit is contained in:
commit
fe654598f6
|
|
@ -31,6 +31,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;
|
||||
|
|
@ -228,8 +229,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;
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ namespace Microsoft.AspNet.Server.Kestrel
|
|||
private Queue<CloseHandle> _closeHandleRunning = new Queue<CloseHandle>();
|
||||
private object _workSync = new Object();
|
||||
private bool _stopImmediate = false;
|
||||
private bool _initCompleted = false;
|
||||
private ExceptionDispatchInfo _closeError;
|
||||
private IKestrelTrace _log;
|
||||
|
||||
|
|
@ -58,6 +59,11 @@ namespace Microsoft.AspNet.Server.Kestrel
|
|||
|
||||
public void Stop(TimeSpan timeout)
|
||||
{
|
||||
if (!_initCompleted)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Post(OnStop, null);
|
||||
if (!_thread.Join((int)timeout.TotalMilliseconds))
|
||||
{
|
||||
|
|
@ -195,8 +201,11 @@ namespace Microsoft.AspNet.Server.Kestrel
|
|||
catch (Exception ex)
|
||||
{
|
||||
tcs.SetException(ex);
|
||||
return;
|
||||
}
|
||||
|
||||
_initCompleted = true;
|
||||
|
||||
try
|
||||
{
|
||||
var ran1 = _loop.Run();
|
||||
|
|
|
|||
Loading…
Reference in New Issue