summaryrefslogtreecommitdiff
path: root/modules/httpd.cpp
diff options
context:
space:
mode:
authorSadie Powell <sadie@witchery.services>2025-03-02 14:51:02 +0000
committerSadie Powell <sadie@witchery.services>2025-03-02 15:27:47 +0000
commitf9911dde529adf3dc03f4f14bbd70756ac2f665c (patch)
tree7c720e4f82fdb30b7d8a22fc0809f50bc862fae3 /modules/httpd.cpp
parenta5e5eb5eb084e8343260ce7bc26ea86798f64fe1 (diff)
Return references instead of pointers from the config system.
We used to return NULL from these methods but now we return an empty block so this can never actually be null now.
Diffstat (limited to 'modules/httpd.cpp')
-rw-r--r--modules/httpd.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/modules/httpd.cpp b/modules/httpd.cpp
index d25742aa2..92382436f 100644
--- a/modules/httpd.cpp
+++ b/modules/httpd.cpp
@@ -360,25 +360,25 @@ public:
this->providers.clear();
}
- void OnReload(Configuration::Conf *config) override
+ void OnReload(Configuration::Conf &config) override
{
- Configuration::Block *conf = config->GetModule(this);
+ Configuration::Block &conf = config.GetModule(this);
std::set<Anope::string> existing;
- for (int i = 0; i < conf->CountBlock("httpd"); ++i)
+ for (int i = 0; i < conf.CountBlock("httpd"); ++i)
{
- Configuration::Block *block = conf->GetBlock("httpd", i);
+ Configuration::Block &block = conf.GetBlock("httpd", i);
- const Anope::string &hname = block->Get<const Anope::string>("name", "httpd/main");
+ const Anope::string &hname = block.Get<const Anope::string>("name", "httpd/main");
existing.insert(hname);
- 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");
+ 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())
{