summaryrefslogtreecommitdiff
path: root/server/server/config.h
diff options
context:
space:
mode:
Diffstat (limited to 'server/server/config.h')
-rwxr-xr-xserver/server/config.h58
1 files changed, 11 insertions, 47 deletions
diff --git a/server/server/config.h b/server/server/config.h
index 94d5df3..5f2ea40 100755
--- a/server/server/config.h
+++ b/server/server/config.h
@@ -9,15 +9,19 @@ class config
{
public:
enum proxy_type {UNKNOWN = -1, HTTP, HTTPS, SOCKS4, SOCKS5};
- struct proxy_entry
+ struct proxy_entry_base
{
- std::string host, login, password, country, state, city;
+ std::string host, login, password;
int port;
size_t speed;
std::list<size_t> speed_list;
proxy_type type;
- proxy_entry(): port(0), speed(0), type(UNKNOWN)
+ proxy_entry_base(): port(0), speed(0), type(UNKNOWN)
{}
+ };
+ struct proxy_entry : public proxy_entry_base
+ {
+ std::string country, state, city;
proxy_entry (std::string login_, std::string password_, std::string host_, int port_, std::string country_, std::string state_, std::string city_, proxy_type t)
{
login = login_;
@@ -30,51 +34,14 @@ public:
type = t;
}
};
-/* struct p_proxy_entry
- {
- std::string host, login, password;
- int port, id, options;
- bool enable_auth;
- proxy_type type;
- p_proxy_entry()
- {
- port = 3128;
- id = 100;
- options = 0;
- type = UNKNOWN;
- enable_auth = false;
- }
- };
-
- struct p_proxy_chain
- {
- std::string name;
- int id;
- struct chain_entry
- {
- int id;
- bool enabled;
- chain_entry()
- {
- id = 100;
- enabled = true;
- }
- };
- std::list<chain_entry> chain;
- p_proxy_chain()
- {
- id = 100;
- }
- };*/
- struct static_proxy_entry
+ struct static_proxy_entry : public proxy_entry_base
{
int port, position;
size_t speed;
std::list<size_t> speed_list;
- std::string host, login, password, label;
- proxy_type type;
- static_proxy_entry(): port(0), position(0), speed(0), type(UNKNOWN)
+ std::string label;
+ static_proxy_entry(): position(0)
{}
static_proxy_entry(std::string login_, std::string password_, std::string host_, int port_, std::string label_, int position_, proxy_type t)
{
@@ -180,13 +147,12 @@ public:
std::list<std::string> *get_deleted_list();
std::list<upload_entry> *get_upload_list();
std::list<conn_server> *get_server_list();
-// std::list<p_proxy_entry> *make_p_proxy_list();
private:
struct cfg_data
{
int ban_time, conn_count, check_interval, debug, dos_conn_count, conn_time, config_reload_interval, proxy_check_interval;
bool ignore_ssl_errors;
- std::string log_path, bind_ip, dos_log_path, /*proxifier_path, */speed_test_file_url;
+ std::string log_path, bind_ip, dos_log_path, speed_test_file_url;
cfg_data()
{
ignore_ssl_errors = false;
@@ -198,7 +164,6 @@ private:
debug = 0;
dos_conn_count = 200;
bind_ip = "0.0.0.0";
-// proxifier_path = "c:/proxifier";
speed_test_file_url = "http://localhost/speed.test";
}
};
@@ -224,7 +189,6 @@ private:
std::list<std::string> firewall_list, deleted_list;
std::list<upload_entry> upload_list;
std::list<conn_server> servers_list;
-// std::list<p_proxy_entry> p_proxy_list;
boost::thread *cfg_reload_thr, *speed_test_thr;
boost::mutex lists_mutex;
};