From 2fd868ae27d74305310e5bcd2a81cd07a87659b3 Mon Sep 17 00:00:00 2001 From: Alex Borisov Date: Wed, 21 Dec 2011 04:06:39 +0200 Subject: Generic proxy button work now. Proxy types support --- client/Config.cpp | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) (limited to 'client/Config.cpp') diff --git a/client/Config.cpp b/client/Config.cpp index 489818e..ab06fb3 100644 --- a/client/Config.cpp +++ b/client/Config.cpp @@ -179,25 +179,24 @@ vector Config::GetCities(string &country, string &state) return cities; } -vector Config::GetProxies(string &country, string &city) +vector Config::GetProxies(string &country, string &city) { string defState = "-"; return GetProxies(country, defState, city); } -vector Config::GetProxies(string &country, string &state, string &city) +vector Config::GetProxies(string &country, string &state, string &city) { - vector proxies; + vector proxies; for (unsigned i = 0; i < genericProxy.size(); i++) { if ((genericProxy[i].state == state) && (genericProxy[i].country == country) && (genericProxy[i].city == city)) { - proxies.push_back(genericProxy[i].host); + proxies.push_back(genericProxy[i]); } } - sort(proxies.begin(), proxies.end()); return proxies; } @@ -213,6 +212,19 @@ ProxyEntryStatic* Config::GetStaticProxy(string& name) return NULL; } +ProxyEntryGeneric* Config::GetGenericProxy(string host, short port) +{ + for (unsigned i = 0; i < genericProxy.size(); i++) + { + if ((host.compare(genericProxy[i].host) == 0) && (port == genericProxy[i].port)) + { + return &genericProxy[i]; + } + } + return NULL; + +} + vector Config::GetStaticProxyGuiLine(unsigned line) { vector staticProxyLine; -- cgit v1.2.3