From e801c6297c00abaf564cc18027394cc38e9fe1a6 Mon Sep 17 00:00:00 2001 From: Stephen Halter Date: Thu, 9 Feb 2017 16:03:11 -0800 Subject: [PATCH] Prevent ODE when ReadStart/Stop() is queued after disposal --- .../Internal/Http/Connection.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Microsoft.AspNetCore.Server.Kestrel/Internal/Http/Connection.cs b/src/Microsoft.AspNetCore.Server.Kestrel/Internal/Http/Connection.cs index 3f61f8530..bdb1e016e 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel/Internal/Http/Connection.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel/Internal/Http/Connection.cs @@ -286,12 +286,22 @@ private void OnRead(UvStreamHandle handle, int status) void IConnectionControl.Pause() { + if (_socket.IsClosed) + { + return; + } + Log.ConnectionPause(ConnectionId); _socket.ReadStop(); } void IConnectionControl.Resume() { + if (_socket.IsClosed) + { + return; + } + Log.ConnectionResume(ConnectionId); try {