summaryrefslogtreecommitdiff
path: root/src/modules/extra
diff options
context:
space:
mode:
authorPeter Powell <petpow@saberuk.com>2013-05-17 05:46:51 +0100
committerattilamolnar <attilamolnar@hush.com>2013-05-27 00:15:30 +0200
commit244a65e8556328642350575c4a94ee8fc1b676b4 (patch)
tree97bf4ff8cf2621a28041a719bd8d766f44014c5b /src/modules/extra
parentee641f3f229143940fbe359ac98863edfdf249ce (diff)
Clean up the FileReader class and all of the modules that use it.
- Modules which use this class will now have to catch a CoreException when opening files if they wish to ignore the failed loading of a file. - m_randquote has been cleaned up massively and the RANDQUOTE command has been removed as it was pretty much useless.
Diffstat (limited to 'src/modules/extra')
-rw-r--r--src/modules/extra/m_ssl_gnutls.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/modules/extra/m_ssl_gnutls.cpp b/src/modules/extra/m_ssl_gnutls.cpp
index 5ae530608..0659f631c 100644
--- a/src/modules/extra/m_ssl_gnutls.cpp
+++ b/src/modules/extra/m_ssl_gnutls.cpp
@@ -360,12 +360,12 @@ class ModuleSSLGnuTLS : public Module
FileReader reader;
- reader.LoadFile(certfile);
- std::string cert_string = reader.Contents();
+ reader.Load(certfile);
+ std::string cert_string = reader.GetString();
gnutls_datum_t cert_datum = { (unsigned char*)cert_string.data(), static_cast<unsigned int>(cert_string.length()) };
- reader.LoadFile(keyfile);
- std::string key_string = reader.Contents();
+ reader.Load(keyfile);
+ std::string key_string = reader.GetString();
gnutls_datum_t key_datum = { (unsigned char*)key_string.data(), static_cast<unsigned int>(key_string.length()) };
// If this fails, no SSL port will work. At all. So, do the smart thing - throw a ModuleException
@@ -431,8 +431,8 @@ class ModuleSSLGnuTLS : public Module
if (!dhfile.empty())
{
// Try to load DH params from file
- reader.LoadFile(dhfile);
- std::string dhstring = reader.Contents();
+ reader.Load(dhfile);
+ std::string dhstring = reader.GetString();
gnutls_datum_t dh_datum = { (unsigned char*)dhstring.data(), static_cast<unsigned int>(dhstring.length()) };
if ((ret = gnutls_dh_params_import_pkcs3(dh_params, &dh_datum, GNUTLS_X509_FMT_PEM)) < 0)