diff options
author | attilamolnar <attilamolnar@hush.com> | 2013-08-16 12:10:55 +0200 |
---|---|---|
committer | attilamolnar <attilamolnar@hush.com> | 2013-08-30 13:15:10 +0200 |
commit | c202dea024542b9c6c6b771bb9a3a081d9eacdc5 (patch) | |
tree | 64f4d5f5c18e685d3cd360107664eec644d5585d /src/modules/extra | |
parent | 1031f333332cf1b09db4fd632f141143ee637c34 (diff) |
Replace OnRehash() with ReadConfig() that is called on boot, on module load and on rehash
This eliminates the need for calling OnRehash() in init()
Diffstat (limited to 'src/modules/extra')
-rw-r--r-- | src/modules/extra/m_ldapauth.cpp | 3 | ||||
-rw-r--r-- | src/modules/extra/m_ldapoper.cpp | 7 | ||||
-rw-r--r-- | src/modules/extra/m_mssql.cpp | 2 | ||||
-rw-r--r-- | src/modules/extra/m_mysql.cpp | 6 | ||||
-rw-r--r-- | src/modules/extra/m_pgsql.cpp | 7 | ||||
-rw-r--r-- | src/modules/extra/m_regex_posix.cpp | 3 | ||||
-rw-r--r-- | src/modules/extra/m_regex_stdlib.cpp | 3 | ||||
-rw-r--r-- | src/modules/extra/m_sqlite3.cpp | 12 | ||||
-rw-r--r-- | src/modules/extra/m_ssl_gnutls.cpp | 3 | ||||
-rw-r--r-- | src/modules/extra/m_ssl_openssl.cpp | 3 |
10 files changed, 11 insertions, 38 deletions
diff --git a/src/modules/extra/m_ldapauth.cpp b/src/modules/extra/m_ldapauth.cpp index 517a6d395..827179f84 100644 --- a/src/modules/extra/m_ldapauth.cpp +++ b/src/modules/extra/m_ldapauth.cpp @@ -122,7 +122,6 @@ public: { ServerInstance->Modules->AddService(ldapAuthed); ServerInstance->Modules->AddService(ldapVhost); - OnRehash(NULL); } ~ModuleLDAPAuth() @@ -131,7 +130,7 @@ public: ldap_unbind_ext(conn, NULL, NULL); } - void OnRehash(User* user) CXX11_OVERRIDE + void ReadConfig(ConfigStatus& status) CXX11_OVERRIDE { ConfigTag* tag = ServerInstance->Config->ConfValue("ldapauth"); whitelistedcidrs.clear(); diff --git a/src/modules/extra/m_ldapoper.cpp b/src/modules/extra/m_ldapoper.cpp index af7b48d07..67ba9a7e5 100644 --- a/src/modules/extra/m_ldapoper.cpp +++ b/src/modules/extra/m_ldapoper.cpp @@ -97,18 +97,13 @@ public: { } - void init() CXX11_OVERRIDE - { - OnRehash(NULL); - } - ~ModuleLDAPAuth() { if (conn) ldap_unbind_ext(conn, NULL, NULL); } - void OnRehash(User* user) CXX11_OVERRIDE + void ReadConfig(ConfigStatus& status) CXX11_OVERRIDE { ConfigTag* tag = ServerInstance->Config->ConfValue("ldapoper"); diff --git a/src/modules/extra/m_mssql.cpp b/src/modules/extra/m_mssql.cpp index e6bac038c..84e02be98 100644 --- a/src/modules/extra/m_mssql.cpp +++ b/src/modules/extra/m_mssql.cpp @@ -779,7 +779,7 @@ class ModuleMsSQL : public Module connections.clear(); } - void OnRehash(User* user) CXX11_OVERRIDE + void ReadConfig(ConfigStatus& status) CXX11_OVERRIDE { queryDispatcher->LockQueue(); ReadConf(); diff --git a/src/modules/extra/m_mysql.cpp b/src/modules/extra/m_mysql.cpp index 2d20a82ab..3aed09416 100644 --- a/src/modules/extra/m_mysql.cpp +++ b/src/modules/extra/m_mysql.cpp @@ -108,7 +108,7 @@ class ModuleSQL : public Module ModuleSQL(); void init() CXX11_OVERRIDE; ~ModuleSQL(); - void OnRehash(User* user) CXX11_OVERRIDE; + void ReadConfig(ConfigStatus& status) CXX11_OVERRIDE; void OnUnloadModule(Module* mod) CXX11_OVERRIDE; Version GetVersion() CXX11_OVERRIDE; }; @@ -381,8 +381,6 @@ void ModuleSQL::init() { Dispatcher = new DispatcherThread(this); ServerInstance->Threads->Start(Dispatcher); - - OnRehash(NULL); } ModuleSQL::~ModuleSQL() @@ -399,7 +397,7 @@ ModuleSQL::~ModuleSQL() } } -void ModuleSQL::OnRehash(User* user) +void ModuleSQL::ReadConfig(ConfigStatus& status) { ConnMap conns; ConfigTagList tags = ServerInstance->Config->ConfTags("database"); diff --git a/src/modules/extra/m_pgsql.cpp b/src/modules/extra/m_pgsql.cpp index 2300c9d5b..1ed5be6f0 100644 --- a/src/modules/extra/m_pgsql.cpp +++ b/src/modules/extra/m_pgsql.cpp @@ -508,18 +508,13 @@ class ModulePgSQL : public Module { } - void init() CXX11_OVERRIDE - { - ReadConf(); - } - ~ModulePgSQL() { delete retimer; ClearAllConnections(); } - void OnRehash(User* user) CXX11_OVERRIDE + void ReadConfig(ConfigStatus& status) CXX11_OVERRIDE { ReadConf(); } diff --git a/src/modules/extra/m_regex_posix.cpp b/src/modules/extra/m_regex_posix.cpp index 935cdbf92..bde5c3947 100644 --- a/src/modules/extra/m_regex_posix.cpp +++ b/src/modules/extra/m_regex_posix.cpp @@ -79,7 +79,6 @@ class ModuleRegexPOSIX : public Module ModuleRegexPOSIX() : ref(this) { ServerInstance->Modules->AddService(ref); - OnRehash(NULL); } Version GetVersion() CXX11_OVERRIDE @@ -87,7 +86,7 @@ class ModuleRegexPOSIX : public Module return Version("Regex Provider Module for POSIX Regular Expressions", VF_VENDOR); } - void OnRehash(User* u) CXX11_OVERRIDE + void ReadConfig(ConfigStatus& status) CXX11_OVERRIDE { ref.extended = ServerInstance->Config->ConfValue("posix")->getBool("extended"); } diff --git a/src/modules/extra/m_regex_stdlib.cpp b/src/modules/extra/m_regex_stdlib.cpp index 5ec358d58..2f75a60a8 100644 --- a/src/modules/extra/m_regex_stdlib.cpp +++ b/src/modules/extra/m_regex_stdlib.cpp @@ -62,7 +62,6 @@ public: ModuleRegexStd() : ref(this) { ServerInstance->Modules->AddService(ref); - OnRehash(NULL); } Version GetVersion() CXX11_OVERRIDE @@ -70,7 +69,7 @@ public: return Version("Regex Provider Module for std::regex", VF_VENDOR); } - void OnRehash(User* u) CXX11_OVERRIDE + void ReadConfig(ConfigStatus& status) CXX11_OVERRIDE { ConfigTag* Conf = ServerInstance->Config->ConfValue("stdregex"); std::string regextype = Conf->getString("type", "ecmascript"); diff --git a/src/modules/extra/m_sqlite3.cpp b/src/modules/extra/m_sqlite3.cpp index 54a2788eb..1c213e8e0 100644 --- a/src/modules/extra/m_sqlite3.cpp +++ b/src/modules/extra/m_sqlite3.cpp @@ -202,11 +202,6 @@ class ModuleSQLite3 : public Module ConnMap conns; public: - void init() CXX11_OVERRIDE - { - ReadConf(); - } - ~ModuleSQLite3() { ClearConns(); @@ -223,7 +218,7 @@ class ModuleSQLite3 : public Module conns.clear(); } - void ReadConf() + void ReadConfig(ConfigStatus& status) CXX11_OVERRIDE { ClearConns(); ConfigTagList tags = ServerInstance->Config->ConfTags("database"); @@ -237,11 +232,6 @@ class ModuleSQLite3 : public Module } } - void OnRehash(User* user) CXX11_OVERRIDE - { - ReadConf(); - } - Version GetVersion() CXX11_OVERRIDE { return Version("sqlite3 provider", VF_VENDOR); diff --git a/src/modules/extra/m_ssl_gnutls.cpp b/src/modules/extra/m_ssl_gnutls.cpp index 53fc38ec0..9f21d6d28 100644 --- a/src/modules/extra/m_ssl_gnutls.cpp +++ b/src/modules/extra/m_ssl_gnutls.cpp @@ -638,7 +638,7 @@ class ModuleSSLGnuTLS : public Module ServerInstance->Modules->AddService(starttls); } - void OnRehash(User* user) CXX11_OVERRIDE + void ReadConfig(ConfigStatus& status) CXX11_OVERRIDE { sslports.clear(); @@ -687,7 +687,6 @@ class ModuleSSLGnuTLS : public Module std::string certfile; std::string cafile; std::string crlfile; - OnRehash(user); ConfigTag* Conf = ServerInstance->Config->ConfValue("gnutls"); diff --git a/src/modules/extra/m_ssl_openssl.cpp b/src/modules/extra/m_ssl_openssl.cpp index 29c3568ef..0957b5912 100644 --- a/src/modules/extra/m_ssl_openssl.cpp +++ b/src/modules/extra/m_ssl_openssl.cpp @@ -502,7 +502,7 @@ class ModuleSSLOpenSSL : public Module } } - void OnRehash(User* user) CXX11_OVERRIDE + void ReadConfig(ConfigStatus& status) CXX11_OVERRIDE { sslports.clear(); @@ -550,7 +550,6 @@ class ModuleSSLOpenSSL : public Module std::string certfile; std::string cafile; std::string dhfile; - OnRehash(user); ConfigTag* conf = ServerInstance->Config->ConfValue("openssl"); |