diff options
author | Sadie Powell <sadie@witchery.services> | 2025-03-02 14:51:02 +0000 |
---|---|---|
committer | Sadie Powell <sadie@witchery.services> | 2025-03-02 15:27:47 +0000 |
commit | f9911dde529adf3dc03f4f14bbd70756ac2f665c (patch) | |
tree | 7c720e4f82fdb30b7d8a22fc0809f50bc862fae3 /modules/operserv/os_session.cpp | |
parent | a5e5eb5eb084e8343260ce7bc26ea86798f64fe1 (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/operserv/os_session.cpp')
-rw-r--r-- | modules/operserv/os_session.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/modules/operserv/os_session.cpp b/modules/operserv/os_session.cpp index 5e2399d53..93ba17473 100644 --- a/modules/operserv/os_session.cpp +++ b/modules/operserv/os_session.cpp @@ -591,21 +591,21 @@ public: ModuleManager::SetPriority(this, PRIORITY_FIRST); } - void OnReload(Configuration::Conf *conf) override + void OnReload(Configuration::Conf &conf) override { - Configuration::Block *block = Config->GetModule(this); + Configuration::Block &block = Config->GetModule(this); - session_limit = block->Get<int>("defaultsessionlimit"); - max_session_kill = block->Get<int>("maxsessionkill"); - session_autokill_expiry = block->Get<time_t>("sessionautokillexpiry"); - sle_reason = block->Get<const Anope::string>("sessionlimitexceeded"); - sle_detailsloc = block->Get<const Anope::string>("sessionlimitdetailsloc"); + session_limit = block.Get<int>("defaultsessionlimit"); + max_session_kill = block.Get<int>("maxsessionkill"); + session_autokill_expiry = block.Get<time_t>("sessionautokillexpiry"); + sle_reason = block.Get<const Anope::string>("sessionlimitexceeded"); + sle_detailsloc = block.Get<const Anope::string>("sessionlimitdetailsloc"); - max_exception_limit = block->Get<int>("maxsessionlimit"); - exception_expiry = block->Get<time_t>("exceptionexpiry"); + max_exception_limit = block.Get<int>("maxsessionlimit"); + exception_expiry = block.Get<time_t>("exceptionexpiry"); - ipv4_cidr = block->Get<unsigned>("session_ipv4_cidr", "32"); - ipv6_cidr = block->Get<unsigned>("session_ipv6_cidr", "128"); + ipv4_cidr = block.Get<unsigned>("session_ipv4_cidr", "32"); + ipv6_cidr = block.Get<unsigned>("session_ipv6_cidr", "128"); if (ipv4_cidr > 32 || ipv6_cidr > 128) throw ConfigException(this->name + ": session CIDR value out of range"); |