Removed unneeded things from Connection

This commit is contained in:
David Fowler 2016-07-18 22:19:45 -07:00
parent bdf9f8dd4e
commit 3078f4914c
1 changed files with 4 additions and 17 deletions

View File

@ -76,12 +76,8 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Http
// Start socket prior to applying the ConnectionFilter // Start socket prior to applying the ConnectionFilter
_socket.ReadStart(_allocCallback, _readCallback, this); _socket.ReadStart(_allocCallback, _readCallback, this);
// Don't initialize _frame until SocketInput and SocketOutput are set to their final values.
if (ServerOptions.ConnectionFilter == null) if (ServerOptions.ConnectionFilter == null)
{ {
_frame.SocketInput = SocketInput;
_frame.SocketOutput = SocketOutput;
_frame.Start(); _frame.Start();
} }
else else
@ -151,9 +147,10 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Http
SocketInput.IncomingFin(); SocketInput.IncomingFin();
_readInputTask.ContinueWith((task, state) => _readInputTask.ContinueWith((task, state) =>
{ {
((Connection)state)._filterContext.Connection.Dispose(); var connection = (Connection)state;
((Connection)state)._filteredStreamAdapter.Dispose(); connection._filterContext.Connection.Dispose();
((Connection)state).SocketInput.Dispose(); connection._filteredStreamAdapter.Dispose();
connection.SocketInput.Dispose();
}, this); }, this);
} }
else else
@ -175,11 +172,6 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Http
_readInputTask = _filteredStreamAdapter.ReadInputAsync(); _readInputTask = _filteredStreamAdapter.ReadInputAsync();
} }
else
{
_frame.SocketInput = SocketInput;
_frame.SocketOutput = SocketOutput;
}
_frame.PrepareRequest = _filterContext.PrepareRequest; _frame.PrepareRequest = _filterContext.PrepareRequest;
@ -254,11 +246,6 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Http
} }
} }
private Frame CreateFrame()
{
return FrameFactory(this);
}
void IConnectionControl.Pause() void IConnectionControl.Pause()
{ {
Log.ConnectionPause(ConnectionId); Log.ConnectionPause(ConnectionId);