diff options
| author | Adam <Adam@anope.org> | 2013-04-11 00:08:28 -0500 |
|---|---|---|
| committer | Adam <Adam@anope.org> | 2013-04-11 00:08:28 -0500 |
| commit | 4f9b7874d6b3a41939ecc2e872ec08d03af7b5f1 (patch) | |
| tree | 43162205d31b277c9ff12ee28b7e3a60d6382316 /modules/extra/m_httpd.cpp | |
| parent | 207c46c871e85b55ae66acc456c6bc412c0c79f9 (diff) | |
Pass new config and the new config reader to the OnReload event, aswell as call it on module load on modules that hook to it
Diffstat (limited to 'modules/extra/m_httpd.cpp')
| -rw-r--r-- | modules/extra/m_httpd.cpp | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/modules/extra/m_httpd.cpp b/modules/extra/m_httpd.cpp index 6972bcdf1..5e643d942 100644 --- a/modules/extra/m_httpd.cpp +++ b/modules/extra/m_httpd.cpp @@ -336,8 +336,6 @@ class HTTPD : public Module Implementation i[] = { I_OnReload }; ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); - - this->OnReload(); } ~HTTPD() @@ -354,22 +352,21 @@ class HTTPD : public Module this->providers.clear(); } - void OnReload() anope_override + void OnReload(ServerConfig *conf, ConfigReader &reader) anope_override { - ConfigReader config; std::set<Anope::string> existing; - for (int i = 0, num = config.Enumerate("httpd"); i < num; ++i) + for (int i = 0, num = reader.Enumerate("httpd"); i < num; ++i) { - Anope::string hname = config.ReadValue("httpd", "name", "httpd/main", i); + Anope::string hname = reader.ReadValue("httpd", "name", "httpd/main", i); existing.insert(hname); - Anope::string ip = config.ReadValue("httpd", "ip", "", i); - int port = config.ReadInteger("httpd", "port", "8080", i, true); - int timeout = config.ReadInteger("httpd", "timeout", "30", i, true); - bool ssl = config.ReadFlag("httpd", "ssl", "no", i); - Anope::string ext_ip = config.ReadValue("httpd", "extforward_ip", "", i); - Anope::string ext_header = config.ReadValue("httpd", "extforward_header", "", i); + Anope::string ip = reader.ReadValue("httpd", "ip", "", i); + int port = reader.ReadInteger("httpd", "port", "8080", i, true); + int timeout = reader.ReadInteger("httpd", "timeout", "30", i, true); + bool ssl = reader.ReadFlag("httpd", "ssl", "no", i); + Anope::string ext_ip = reader.ReadValue("httpd", "extforward_ip", "", i); + Anope::string ext_header = reader.ReadValue("httpd", "extforward_header", "", i); if (ip.empty()) { |
