Commit 0f8c8f31 authored by justcoding121's avatar justcoding121

cleanup

parent 989c8831
...@@ -143,7 +143,7 @@ namespace Titanium.Web.Proxy ...@@ -143,7 +143,7 @@ namespace Titanium.Web.Proxy
http2Supported = connection.NegotiatedApplicationProtocol == SslApplicationProtocol.Http2; http2Supported = connection.NegotiatedApplicationProtocol == SslApplicationProtocol.Http2;
//release connection back to pool intead of closing when connection pool is enabled. //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; SslStream sslStream = null;
...@@ -316,14 +316,14 @@ namespace Titanium.Web.Proxy ...@@ -316,14 +316,14 @@ namespace Titanium.Web.Proxy
} }
finally finally
{ {
clientStream.Dispose();
if (prefetchConnectionTask != null) if (prefetchConnectionTask != null)
{ {
var connection = await prefetchConnectionTask; var connection = await prefetchConnectionTask;
await tcpConnectionFactory.Release(connection, closeServerConnection || !EnableConnectionPool); await tcpConnectionFactory.Release(connection, closeServerConnection);
} }
clientStream.Dispose();
if (!cancellationTokenSource.IsCancellationRequested) if (!cancellationTokenSource.IsCancellationRequested)
{ {
cancellationTokenSource.Cancel(); cancellationTokenSource.Cancel();
......
...@@ -119,7 +119,7 @@ namespace Titanium.Web.Proxy.Network.Tcp ...@@ -119,7 +119,7 @@ namespace Titanium.Web.Proxy.Network.Tcp
return; return;
} }
if (close || connection.IsWinAuthenticated) if (close || connection.IsWinAuthenticated || !server.EnableConnectionPool)
{ {
disposalBag.Add(connection); disposalBag.Add(connection);
return; return;
...@@ -392,3 +392,4 @@ namespace Titanium.Web.Proxy.Network.Tcp ...@@ -392,3 +392,4 @@ namespace Titanium.Web.Proxy.Network.Tcp
} }
} }
} }
...@@ -290,7 +290,7 @@ namespace Titanium.Web.Proxy ...@@ -290,7 +290,7 @@ namespace Titanium.Web.Proxy
|| serverConnection != await prefetchConnectionTask) || serverConnection != await prefetchConnectionTask)
{ {
await tcpConnectionFactory.Release(serverConnection, await tcpConnectionFactory.Release(serverConnection,
closeServerConnection || !EnableConnectionPool); closeServerConnection);
} }
} }
......
...@@ -155,14 +155,14 @@ namespace Titanium.Web.Proxy ...@@ -155,14 +155,14 @@ namespace Titanium.Web.Proxy
} }
finally finally
{ {
clientStream.Dispose();
if (prefetchConnectionTask != null) if (prefetchConnectionTask != null)
{ {
var connection = await prefetchConnectionTask; var connection = await prefetchConnectionTask;
await tcpConnectionFactory.Release(connection, closeServerConnection || !EnableConnectionPool); await tcpConnectionFactory.Release(connection, closeServerConnection);
} }
clientStream.Dispose();
if (!cancellationTokenSource.IsCancellationRequested) if (!cancellationTokenSource.IsCancellationRequested)
{ {
cancellationTokenSource.Cancel(); 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