Move ECONNRESET value check to server initialization.
This commit is contained in:
parent
7e7f21ec49
commit
9a06bf39ab
|
|
@ -40,8 +40,6 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Http
|
||||||
private ConnectionState _connectionState;
|
private ConnectionState _connectionState;
|
||||||
private TaskCompletionSource<object> _socketClosedTcs;
|
private TaskCompletionSource<object> _socketClosedTcs;
|
||||||
|
|
||||||
bool _eConnResetChecked = false;
|
|
||||||
|
|
||||||
public Connection(ListenerContext context, UvStreamHandle socket) : base(context)
|
public Connection(ListenerContext context, UvStreamHandle socket) : base(context)
|
||||||
{
|
{
|
||||||
_socket = socket;
|
_socket = socket;
|
||||||
|
|
@ -202,7 +200,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Http
|
||||||
if (_socketClosedTcs != null)
|
if (_socketClosedTcs != null)
|
||||||
{
|
{
|
||||||
// This is always waited on synchronously, so it's safe to
|
// This is always waited on synchronously, so it's safe to
|
||||||
// call on the libuv thread.
|
// call on the libuv thread.
|
||||||
_socketClosedTcs.TrySetResult(null);
|
_socketClosedTcs.TrySetResult(null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -274,12 +272,6 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Http
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!_eConnResetChecked && !Constants.ECONNRESET.HasValue)
|
|
||||||
{
|
|
||||||
Log.LogWarning("Unable to determine ECONNRESET value on this platform.");
|
|
||||||
_eConnResetChecked = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
var normalRead = status > 0;
|
var normalRead = status > 0;
|
||||||
var normalDone = status == Constants.ECONNRESET || status == Constants.EOF;
|
var normalDone = status == Constants.ECONNRESET || status == Constants.EOF;
|
||||||
var errorDone = !(normalDone || normalRead);
|
var errorDone = !(normalDone || normalRead);
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
// Copyright (c) .NET Foundation. All rights reserved.
|
// Copyright (c) .NET Foundation. All rights reserved.
|
||||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||||
|
|
||||||
using System;
|
|
||||||
using Microsoft.Extensions.PlatformAbstractions;
|
using Microsoft.Extensions.PlatformAbstractions;
|
||||||
|
|
||||||
namespace Microsoft.AspNetCore.Server.Kestrel.Infrastructure
|
namespace Microsoft.AspNetCore.Server.Kestrel.Infrastructure
|
||||||
|
|
|
||||||
|
|
@ -94,6 +94,11 @@ namespace Microsoft.AspNetCore.Server.Kestrel
|
||||||
"ThreadCount must be positive.");
|
"ThreadCount must be positive.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!Constants.ECONNRESET.HasValue)
|
||||||
|
{
|
||||||
|
_logger.LogWarning("Unable to determine ECONNRESET value on this platform.");
|
||||||
|
}
|
||||||
|
|
||||||
engine.Start(threadCount);
|
engine.Start(threadCount);
|
||||||
var atLeastOneListener = false;
|
var atLeastOneListener = false;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue