Treat more exceptions from Socket.ReceiveAsync as aborted connections (#2122)
This commit is contained in:
parent
34c3233db9
commit
c57aa3b2a8
|
|
@ -136,8 +136,11 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets
|
||||||
_trace.ConnectionReset(ConnectionId);
|
_trace.ConnectionReset(ConnectionId);
|
||||||
}
|
}
|
||||||
catch (SocketException ex) when (ex.SocketErrorCode == SocketError.OperationAborted ||
|
catch (SocketException ex) when (ex.SocketErrorCode == SocketError.OperationAborted ||
|
||||||
ex.SocketErrorCode == SocketError.Interrupted)
|
ex.SocketErrorCode == SocketError.ConnectionAborted ||
|
||||||
|
ex.SocketErrorCode == SocketError.Interrupted ||
|
||||||
|
ex.SocketErrorCode == SocketError.InvalidArgument)
|
||||||
{
|
{
|
||||||
|
// Calling Dispose after ReceiveAsync can cause an "InvalidArgument" error on *nix.
|
||||||
error = new ConnectionAbortedException();
|
error = new ConnectionAbortedException();
|
||||||
_trace.ConnectionError(ConnectionId, error);
|
_trace.ConnectionError(ConnectionId, error);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue