Commit ec0d99bb authored by titanium007's avatar titanium007

remove lock for now

parent 4633f88f
...@@ -24,24 +24,24 @@ namespace Titanium.Web.Proxy.Http ...@@ -24,24 +24,24 @@ namespace Titanium.Web.Proxy.Http
public static TcpConnection GetClient(string Hostname, int port, bool IsSecure) public static TcpConnection GetClient(string Hostname, int port, bool IsSecure)
{ {
var key = string.Concat(Hostname, ":", port, ":", IsSecure); //var key = string.Concat(Hostname, ":", port, ":", IsSecure);
TcpConnection client; //TcpConnection client;
lock (ConnectionCache) //lock (ConnectionCache)
{ //{
Stack<TcpConnection> connections; // Stack<TcpConnection> connections;
if (!ConnectionCache.TryGetValue(key, out connections)) // if (!ConnectionCache.TryGetValue(key, out connections))
{ // {
return CreateClient(Hostname, port, IsSecure); // return CreateClient(Hostname, port, IsSecure);
} // }
if (connections.Count > 0) // if (connections.Count > 0)
{ // {
client = connections.Pop(); // client = connections.Pop();
} // }
else // else
return CreateClient(Hostname, port, IsSecure); return CreateClient(Hostname, port, IsSecure);
} //}
return client; //return client;
} }
private static TcpConnection CreateClient(string Hostname, int port, bool IsSecure) private static TcpConnection CreateClient(string Hostname, int port, bool IsSecure)
......
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