From 244a65e8556328642350575c4a94ee8fc1b676b4 Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Fri, 17 May 2013 05:46:51 +0100 Subject: 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. --- src/modules/extra/m_ssl_gnutls.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/modules/extra') 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(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(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(dhstring.length()) }; if ((ret = gnutls_dh_params_import_pkcs3(dh_params, &dh_datum, GNUTLS_X509_FMT_PEM)) < 0) -- cgit v1.2.3