summaryrefslogtreecommitdiff
path: root/client/Config.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'client/Config.cpp')
-rw-r--r--client/Config.cpp22
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;