diff options
| author | 2018-12-18 19:06:56 -0600 | |
|---|---|---|
| committer | 2018-12-19 01:06:56 +0000 | |
| commit | 4fbd6681fedbff9b4cb04cc774f785cbe8b5c35b (patch) | |
| tree | 9df58ec3e4cf2c191b4ae0051118606957d89db6 /src/modules/m_httpd_acl.cpp | |
| parent | Fix not propagating rehashes properly across the network. (diff) | |
Make more modules rehash atomically (#1535)
Have each module validate the values it loads before setting them, so
any errors don't result in partial application of the configs
Diffstat (limited to 'src/modules/m_httpd_acl.cpp')
| -rw-r--r-- | src/modules/m_httpd_acl.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/modules/m_httpd_acl.cpp b/src/modules/m_httpd_acl.cpp index 2dbc1be69..49710c219 100644 --- a/src/modules/m_httpd_acl.cpp +++ b/src/modules/m_httpd_acl.cpp @@ -51,7 +51,7 @@ class ModuleHTTPAccessList : public Module, public HTTPACLEventListener void ReadConfig(ConfigStatus& status) CXX11_OVERRIDE { - acl_list.clear(); + std::vector<HTTPACL> new_acls; ConfigTagList acls = ServerInstance->Config->ConfTags("httpdacl"); for (ConfigIter i = acls.first; i != acls.second; i++) { @@ -89,8 +89,9 @@ class ModuleHTTPAccessList : public Module, public HTTPACLEventListener ServerInstance->Logs->Log(MODNAME, LOG_DEBUG, "Read ACL: path=%s pass=%s whitelist=%s blacklist=%s", path.c_str(), password.c_str(), whitelist.c_str(), blacklist.c_str()); - acl_list.push_back(HTTPACL(path, username, password, whitelist, blacklist)); + new_acls.push_back(HTTPACL(path, username, password, whitelist, blacklist)); } + acl_list.swap(new_acls); } void BlockAccess(HTTPRequest* http, unsigned int returnval, const std::string &extraheaderkey = "", const std::string &extraheaderval="") |
