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