Commit 2276a81d 2276a81d502268ccb737393a525022de2ef68c53 by Christian Gerdes

Changed the way the ZeroHashtable works to prevent locking or concurrency issues.

1 parent b3c9820c
......@@ -75,7 +75,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(32));
f.SetValue(null, new ZeroHashtable());
}
void undoIt()
......@@ -89,12 +89,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; }
}
public override void Add(object key, object value) { return; }
public override object this[object key] { get { return null; } set { return; } }
}
/// <summary>
......