diff options
author | Gluzskiy Alexandr <sss@sss.chaoslab.ru> | 2011-12-21 20:56:17 +0200 |
---|---|---|
committer | Gluzskiy Alexandr <sss@sss.chaoslab.ru> | 2011-12-21 20:56:17 +0200 |
commit | ac5fac669d8162a81f77cc2f34be85f07e31f8f6 (patch) | |
tree | 1251aa0dd6af1b857156f9b2425d057736b260b2 /client/Config.cpp | |
parent | bf11b1575ecbc77bf8280733366ae92dfbb31300 (diff) | |
parent | 2fd868ae27d74305310e5bcd2a81cd07a87659b3 (diff) |
Merge branch 'master' of ssh://sss.chaoslab.ru//home/private_git/proxy_ui
Diffstat (limited to 'client/Config.cpp')
-rw-r--r-- | client/Config.cpp | 22 |
1 files changed, 17 insertions, 5 deletions
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<string> Config::GetCities(string &country, string &state) return cities; } -vector<string> Config::GetProxies(string &country, string &city) +vector<Proxy> Config::GetProxies(string &country, string &city) { string defState = "-"; return GetProxies(country, defState, city); } -vector<string> Config::GetProxies(string &country, string &state, string &city) +vector<Proxy> Config::GetProxies(string &country, string &state, string &city) { - vector<string> proxies; + vector<Proxy> 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<ProxyEntryStatic> Config::GetStaticProxyGuiLine(unsigned line) { vector<ProxyEntryStatic> staticProxyLine; |