summaryrefslogtreecommitdiff
path: root/modules/extra/m_ssl.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_ssl.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_ssl.cpp')
-rw-r--r--modules/extra/m_ssl.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/modules/extra/m_ssl.cpp b/modules/extra/m_ssl.cpp
index 95de6694a..3219830e7 100644
--- a/modules/extra/m_ssl.cpp
+++ b/modules/extra/m_ssl.cpp
@@ -136,10 +136,12 @@ class SSLModule : public Module
SSL_CTX_free(server_ctx);
}
- void OnReload(ServerConfig *conf, ConfigReader &reader) anope_override
+ void OnReload(Configuration::Conf *conf) anope_override
{
- this->certfile = reader.ReadValue("ssl", "cert", "data/anope.crt", 0);
- this->keyfile = reader.ReadValue("ssl", "key", "data/anope.key", 0);
+ Configuration::Block *config = conf->GetModule(this);
+
+ this->certfile = config->Get<const Anope::string &>("cert", "data/anope.crt");
+ this->keyfile = config->Get<const Anope::string &>("key", "data/anope.key");
if (Anope::IsFile(this->certfile.c_str()))
{
@@ -182,9 +184,9 @@ class SSLModule : public Module
void OnPreServerConnect() anope_override
{
- ConfigReader reader;
+ Configuration::Block *config = Config->GetBlock("uplink", Anope::CurrentUplink);
- if (reader.ReadFlag("uplink", "ssl", "no", Anope::CurrentUplink))
+ if (config->Get<bool>("ssl"))
{
this->service.Init(UplinkSock);
}