Commit ed3ce01c authored by justcoding121's avatar justcoding121

remove caching which can cause errors

parent 65b923fb
...@@ -129,6 +129,7 @@ namespace Titanium.Web.Proxy.Helpers ...@@ -129,6 +129,7 @@ namespace Titanium.Web.Proxy.Helpers
} }
store.Close(); store.Close();
if (certificate != null && !certificateCache.ContainsKey(certificateName)) if (certificate != null && !certificateCache.ContainsKey(certificateName))
certificateCache.Add(certificateName, new CachedCertificate() { Certificate = certificate }); certificateCache.Add(certificateName, new CachedCertificate() { Certificate = certificate });
......
...@@ -80,14 +80,6 @@ namespace Titanium.Web.Proxy.Network ...@@ -80,14 +80,6 @@ namespace Titanium.Web.Proxy.Network
if (cached == null) if (cached == null)
cached = await CreateClient(connectRequest, hostname, port, isHttps, version).ConfigureAwait(false); cached = await CreateClient(connectRequest, hostname, port, isHttps, version).ConfigureAwait(false);
//just create one more preemptively
if (cachedConnections == null || cachedConnections.Count() < 2)
{
var task = CreateClient(connectRequest, hostname, port, isHttps, version)
.ContinueWith(async (x) => { if (x.Status == TaskStatus.RanToCompletion) await ReleaseClient(x.Result); });
}
return cached; return cached;
} }
......
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