// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_2_0 && SECURITY_DEP
+#if SECURITY_DEP
+
+#if MONOTOUCH
+using Mono.Security.Authenticode;
+#else
+extern alias MonoSecurity;
+using MonoSecurity::Mono.Security.Authenticode;
+#endif
using System.IO;
using System.Net.Sockets;
using System.Collections;
+using System.Collections.Generic;
using System.Security.Cryptography;
using System.Security.Cryptography.X509Certificates;
using System.Threading;
-using Mono.Security.Authenticode;
namespace System.Net {
sealed class EndPointListener
X509Certificate2 cert;
AsymmetricAlgorithm key;
bool secure;
- Hashtable unregistered;
+ Dictionary<HttpConnection, HttpConnection> unregistered;
public EndPointListener (IPAddress addr, int port, bool secure)
{
args.Completed += OnAccept;
sock.AcceptAsync (args);
prefixes = new Hashtable ();
- unregistered = new Hashtable ();
+ unregistered = new Dictionary<HttpConnection, HttpConnection> ();
}
void LoadCertificateAndKey (IPAddress addr, int port)
{
sock.Close ();
lock (unregistered) {
- foreach (HttpConnection c in unregistered.Keys)
+ //
+ // Clone the list because RemoveConnection can be called from Close
+ //
+ var connections = new List<HttpConnection> (unregistered.Keys);
+
+ foreach (HttpConnection c in connections)
c.Close (true);
unregistered.Clear ();
}