summaryrefslogtreecommitdiff
path: root/modules/extra/m_httpd.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2013-05-05 01:55:04 -0400
committerAdam <Adam@anope.org>2013-05-05 01:55:04 -0400
commit1d0bb9b26b7ad58ab0bf979ac046f4511b3bf12b (patch)
tree4486f0784bdf050fd7eb225c0cb9df352ce1f45a /modules/extra/m_httpd.cpp
parent781defb7076ddfddf723ca08cd0a518b6657b64f (diff)
Rework the config file reader to be much more flexible and move many configuration directives to the actual modules they are used in.
Diffstat (limited to 'modules/extra/m_httpd.cpp')
-rw-r--r--modules/extra/m_httpd.cpp21
1 files changed, 12 insertions, 9 deletions
diff --git a/modules/extra/m_httpd.cpp b/modules/extra/m_httpd.cpp
index 5e643d942..87d1ad6a1 100644
--- a/modules/extra/m_httpd.cpp
+++ b/modules/extra/m_httpd.cpp
@@ -352,21 +352,24 @@ class HTTPD : public Module
this->providers.clear();
}
- void OnReload(ServerConfig *conf, ConfigReader &reader) anope_override
+ void OnReload(Configuration::Conf *conf) anope_override
{
std::set<Anope::string> existing;
- for (int i = 0, num = reader.Enumerate("httpd"); i < num; ++i)
+ for (int i = 0; i < conf->CountBlock("httpd"); ++i)
{
- Anope::string hname = reader.ReadValue("httpd", "name", "httpd/main", i);
+ Configuration::Block *block = conf->GetBlock("httpd", i);
+
+
+ const Anope::string &hname = block->Get<const Anope::string &>("name", "httpd/main");
existing.insert(hname);
- 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);
+ Anope::string ip = block->Get<const Anope::string &>("ip");
+ int port = block->Get<int>("port", "8080");
+ int timeout = block->Get<int>("timeout", "30");
+ bool ssl = block->Get<bool>("ssl", "no");
+ Anope::string ext_ip = block->Get<const Anope::string &>("extforward_ip");
+ Anope::string ext_header = block->Get<const Anope::string &>("extforward_header");
if (ip.empty())
{