summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-06-24 19:18:29 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-06-24 19:18:35 +0300
commit6187ca379f38748fe5bbb00d9e5ec1d74c941baf (patch)
tree82de4aa0f8c1b1c951eff363a4d3f711fddfd6ff /plugins
parent50006be134fb837e7a2bcabc7eb84fd5515da5f4 (diff)
code simplification
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);