summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/ProxySwitch/src/ip.cpp15
-rw-r--r--plugins/ProxySwitch/src/main.cpp2
2 files changed, 8 insertions, 9 deletions
diff --git a/plugins/ProxySwitch/src/ip.cpp b/plugins/ProxySwitch/src/ip.cpp
index 87c5962433..f421f23ec2 100644
--- a/plugins/ProxySwitch/src/ip.cpp
+++ b/plugins/ProxySwitch/src/ip.cpp
@@ -631,15 +631,14 @@ int ManageConnections(WPARAM wParam, LPARAM)
break;
}
- if ((pFound && info->connected) || (!pFound && !info->connected))
- return 0;
-
- if (!pFound)
+ if (!pFound && info->connected) {
g_arConnections.insert(new ACTIVE_CONNECTION(info->local.sin_addr.s_addr, info->local.sin_port));
- else
- g_arConnections.remove(g_arConnections.indexOf(&pFound));
-
- SetEvent(hEventRebound);
+ SetEvent(hEventRebound);
+ }
+ else if (pFound && !info->connected) {
+ g_arConnections.remove(pFound);
+ SetEvent(hEventRebound);
+ }
return 0;
}
diff --git a/plugins/ProxySwitch/src/main.cpp b/plugins/ProxySwitch/src/main.cpp
index 3b4f8f89a8..50b280a77b 100644
--- a/plugins/ProxySwitch/src/main.cpp
+++ b/plugins/ProxySwitch/src/main.cpp
@@ -29,7 +29,7 @@ CMPlugin::CMPlugin() :
HGENMENU hEnableDisablePopupMenu = 0;
-OBJLIST<ACTIVE_CONNECTION> g_arConnections(10);
+OBJLIST<ACTIVE_CONNECTION> g_arConnections(10, PtrKeySortT);
mir_cs csConnection_List;
OBJLIST<NETWORK_INTERFACE> g_arNIF(10);