Commit d3bc1be6 d3bc1be6db2211b3a5071081ba09583783d12cc1 by Christian Gerdes

Fix in SSL Session Cache Disabled

Small performance fix.
1 parent c2cc16a9
......@@ -55,7 +55,7 @@ namespace LIL_VSTT_Plugins
System.Reflection.Assembly asm = System.Reflection.Assembly.GetAssembly(typeof(System.Net.Security.SslStream));
Type t = asm.GetType("System.Net.Security.SslSessionsCache");
System.Reflection.FieldInfo f = t.GetField("s_CachedCreds", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Static);
f.SetValue(null, new ZeroHashtable());
f.SetValue(null, new ZeroHashtable(32));
}
void undoIt()
......@@ -69,6 +69,8 @@ namespace LIL_VSTT_Plugins
public class ZeroHashtable : System.Collections.Hashtable
{
public ZeroHashtable(int capacity) : base(capacity) { }
public override int Count
{
get { if(base.Count % 32 == 0) this.Clear(); return 0; }
......