Commit 0f8c8f31 authored by justcoding121's avatar justcoding121

cleanup

parent 989c8831
......@@ -143,7 +143,7 @@ namespace Titanium.Web.Proxy
http2Supported = connection.NegotiatedApplicationProtocol == SslApplicationProtocol.Http2;
//release connection back to pool intead of closing when connection pool is enabled.
await tcpConnectionFactory.Release(connection, !EnableConnectionPool);
await tcpConnectionFactory.Release(connection);
}
SslStream sslStream = null;
......@@ -316,14 +316,14 @@ namespace Titanium.Web.Proxy
}
finally
{
clientStream.Dispose();
if (prefetchConnectionTask != null)
{
var connection = await prefetchConnectionTask;
await tcpConnectionFactory.Release(connection, closeServerConnection || !EnableConnectionPool);
await tcpConnectionFactory.Release(connection, closeServerConnection);
}
clientStream.Dispose();
if (!cancellationTokenSource.IsCancellationRequested)
{
cancellationTokenSource.Cancel();
......
......@@ -119,7 +119,7 @@ namespace Titanium.Web.Proxy.Network.Tcp
return;
}
if (close || connection.IsWinAuthenticated)
if (close || connection.IsWinAuthenticated || !server.EnableConnectionPool)
{
disposalBag.Add(connection);
return;
......@@ -392,3 +392,4 @@ namespace Titanium.Web.Proxy.Network.Tcp
}
}
}
......@@ -290,7 +290,7 @@ namespace Titanium.Web.Proxy
|| serverConnection != await prefetchConnectionTask)
{
await tcpConnectionFactory.Release(serverConnection,
closeServerConnection || !EnableConnectionPool);
closeServerConnection);
}
}
......
......@@ -155,14 +155,14 @@ namespace Titanium.Web.Proxy
}
finally
{
clientStream.Dispose();
if (prefetchConnectionTask != null)
{
var connection = await prefetchConnectionTask;
await tcpConnectionFactory.Release(connection, closeServerConnection || !EnableConnectionPool);
await tcpConnectionFactory.Release(connection, closeServerConnection);
}
clientStream.Dispose();
if (!cancellationTokenSource.IsCancellationRequested)
{
cancellationTokenSource.Cancel();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment