File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
src/Microsoft.AspNet.Server.Kestrel/Http Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -92,6 +92,8 @@ private void OnRead(int status, Exception error)
92
92
SocketInput . RemoteIntakeFin = true ;
93
93
_read . Dispose ( ) ;
94
94
_read = null ;
95
+ _listener . RemoveConnection ( this ) ;
96
+ _socket . Dispose ( ) ;
95
97
96
98
if ( errorDone && error != null )
97
99
{
@@ -136,6 +138,9 @@ void IConnectionControl.End(ProduceEndType endType)
136
138
KestrelTrace . Log . ConnectionWriteFin ( _connectionId , 0 ) ;
137
139
Thread . Post ( ( ) =>
138
140
{
141
+ if ( _read == null )
142
+ return ;
143
+
139
144
KestrelTrace . Log . ConnectionWriteFin ( _connectionId , 1 ) ;
140
145
new UvShutdownReq (
141
146
Thread . Loop ,
@@ -158,7 +163,10 @@ void IConnectionControl.End(ProduceEndType endType)
158
163
Thread . Post ( ( ) =>
159
164
{
160
165
_listener . RemoveConnection ( this ) ;
161
- _read ? . Dispose ( ) ; // Remove the ? once connections closed by the client work
166
+ if ( _read == null )
167
+ return ;
168
+
169
+ _read . Dispose ( ) ;
162
170
_socket . Dispose ( ) ;
163
171
KestrelTrace . Log . ConnectionStop ( _connectionId ) ;
164
172
} ) ;
You can’t perform that action at this time.
0 commit comments