diff options
author | Alex Borisov <borisov.alexandr@rambler.ru> | 2011-12-21 04:06:39 +0200 |
---|---|---|
committer | Alex Borisov <borisov.alexandr@rambler.ru> | 2011-12-21 04:06:39 +0200 |
commit | 2fd868ae27d74305310e5bcd2a81cd07a87659b3 (patch) | |
tree | 03141523c396af45835e070e858216633a05fc6b /client/Config.cpp | |
parent | 2f559d0e236c797e670f47cd70f52cde01092389 (diff) |
Generic proxy button work now. Proxy types support
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; |