diff options
author | Gluzskiy Alexandr <sss@sss.chaoslab.ru> | 2011-12-21 20:55:46 +0200 |
---|---|---|
committer | Gluzskiy Alexandr <sss@sss.chaoslab.ru> | 2011-12-21 20:55:46 +0200 |
commit | bf11b1575ecbc77bf8280733366ae92dfbb31300 (patch) | |
tree | 7a6f4764970594a36234ce665f96d5fa5a2b0ce2 | |
parent | 2f559d0e236c797e670f47cd70f52cde01092389 (diff) |
fix: cleaning lists on config reload
-rwxr-xr-x | server/server/config.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/server/server/config.cpp b/server/server/config.cpp index caa67c1..55d8d1e 100755 --- a/server/server/config.cpp +++ b/server/server/config.cpp @@ -130,6 +130,8 @@ void config::load_servers_list(char* pth) config.close(); if(!cfg_str.empty()) { + if(!servers_list.empty()) + servers_list.clear(); std::string::size_type p1 = 0, p2 = 0, l = 1; if(cfg_str.find("\r\n") != std::string::npos) l = 2; @@ -175,6 +177,8 @@ void config::load_upload_list(char *pth) p2 = cfg_str.find(';'); while(p2 != std::string::npos) { + if(!upload_list.empty()) + upload_list.clear(); std::string line = cfg_str.substr(p1, p2-p1); p1 = p2+l+1; std::string::size_type lp1 = 0, lp2 = 0; @@ -229,6 +233,8 @@ void config::load_proxy_list(char *pth) config.close(); if(!cfg_str.empty()) { + if(!proxy_list.empty()) + proxy_list.clear(); std::string::size_type p1 = 0, p2 = 0, l = 1; if(cfg_str.rfind("\r\n") != std::string::npos) l = 2; @@ -312,6 +318,8 @@ void config::load_static_proxy_list(char *pth) config.close(); if(!cfg_str.empty()) { + if(!static_proxy_list.empty()) + static_proxy_list.clear(); std::string::size_type p1 = 0, p2 = 0, l = 1; if(cfg_str.rfind("\r\n") != std::string::npos) l = 2; @@ -388,6 +396,8 @@ void config::load_firewall_list(char* pth) config.close(); if(!cfg_str.empty()) { + if(!firewall_list.empty()) + firewall_list.clear(); std::string::size_type p1 = 0, p2 = 0, l = 1; if(cfg_str.find("\r\n") != std::string::npos) l = 2; @@ -417,6 +427,8 @@ void config::load_deleted_list(char* pth) config.close(); if(!cfg_str.empty()) { + if(!deleted_list.empty()) + deleted_list.clear(); std::string::size_type p1 = 0, p2 = 0, l = 1; if(cfg_str.find("\r\n") != std::string::npos) l = 2; |