Commit 8e0602a4 authored by justcoding121's avatar justcoding121

potential errors in close can prevent decrement getting called

parent 92ddc04f
...@@ -40,9 +40,8 @@ namespace Titanium.Web.Proxy.Network.Tcp ...@@ -40,9 +40,8 @@ namespace Titanium.Web.Proxy.Network.Tcp
/// </summary> /// </summary>
public void Dispose() public void Dispose()
{ {
tcpClient.CloseSocket();
proxyServer.UpdateClientConnectionCount(false); proxyServer.UpdateClientConnectionCount(false);
tcpClient.CloseSocket();
} }
} }
} }
using System; using System;
using System.Net; using System.Net;
using System.Net.Security;
using System.Net.Sockets; using System.Net.Sockets;
using StreamExtended.Network; using StreamExtended.Network;
using Titanium.Web.Proxy.Extensions; using Titanium.Web.Proxy.Extensions;
...@@ -83,9 +82,9 @@ namespace Titanium.Web.Proxy.Network.Tcp ...@@ -83,9 +82,9 @@ namespace Titanium.Web.Proxy.Network.Tcp
/// </summary> /// </summary>
public void Dispose() public void Dispose()
{ {
proxyServer.UpdateServerConnectionCount(false);
Stream?.Dispose(); Stream?.Dispose();
tcpClient.CloseSocket(); tcpClient.CloseSocket();
proxyServer.UpdateServerConnectionCount(false);
} }
} }
} }
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