narrow lock scope when connections end
This commit is contained in:
parent
fed7c44829
commit
132263e767
|
|
@ -328,20 +328,20 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Http
|
||||||
|
|
||||||
void IConnectionControl.End(ProduceEndType endType)
|
void IConnectionControl.End(ProduceEndType endType)
|
||||||
{
|
{
|
||||||
lock (_stateLock)
|
switch (endType)
|
||||||
{
|
{
|
||||||
switch (endType)
|
case ProduceEndType.ConnectionKeepAlive:
|
||||||
{
|
if (_connectionState != ConnectionState.Open)
|
||||||
case ProduceEndType.ConnectionKeepAlive:
|
{
|
||||||
if (_connectionState != ConnectionState.Open)
|
return;
|
||||||
{
|
}
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
Log.ConnectionKeepAlive(ConnectionId);
|
Log.ConnectionKeepAlive(ConnectionId);
|
||||||
break;
|
break;
|
||||||
case ProduceEndType.SocketShutdown:
|
case ProduceEndType.SocketShutdown:
|
||||||
case ProduceEndType.SocketDisconnect:
|
case ProduceEndType.SocketDisconnect:
|
||||||
|
lock (_stateLock)
|
||||||
|
{
|
||||||
if (_connectionState == ConnectionState.Disconnecting ||
|
if (_connectionState == ConnectionState.Disconnecting ||
|
||||||
_connectionState == ConnectionState.SocketClosed)
|
_connectionState == ConnectionState.SocketClosed)
|
||||||
{
|
{
|
||||||
|
|
@ -352,7 +352,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Http
|
||||||
Log.ConnectionDisconnect(ConnectionId);
|
Log.ConnectionDisconnect(ConnectionId);
|
||||||
_rawSocketOutput.End(endType);
|
_rawSocketOutput.End(endType);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue