summaryrefslogtreecommitdiff
path: root/src/modules/extra
diff options
context:
space:
mode:
authorPeter Powell <petpow@saberuk.com>2017-11-25 12:50:11 +0000
committerPeter Powell <petpow@saberuk.com>2017-11-25 13:38:02 +0000
commit6abc789577a86ffcdce8fae81b37f825d9ca4226 (patch)
tree6c485e33261a0e4dfab8005e2f93b3063a7b98b5 /src/modules/extra
parent1dca8b79edf65c0e5e846cc120f1321fb0a1d15c (diff)
Convert GenRandom to std::function.
Diffstat (limited to 'src/modules/extra')
-rw-r--r--src/modules/extra/m_ssl_gnutls.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/modules/extra/m_ssl_gnutls.cpp b/src/modules/extra/m_ssl_gnutls.cpp
index 2d278c967..97fdf504c 100644
--- a/src/modules/extra/m_ssl_gnutls.cpp
+++ b/src/modules/extra/m_ssl_gnutls.cpp
@@ -112,10 +112,10 @@ typedef gnutls_connection_end_t inspircd_gnutls_session_init_flags_t;
static Module* thismod;
-class RandGen : public HandlerBase2<void, char*, size_t>
+class RandGen
{
public:
- void Call(char* buffer, size_t len) CXX11_OVERRIDE
+ static void Call(char* buffer, size_t len)
{
#ifdef GNUTLS_HAS_RND
gnutls_rnd(GNUTLS_RND_RANDOM, buffer, len);
@@ -1272,7 +1272,6 @@ class ModuleSSLGnuTLS : public Module
// First member of the class, gets constructed first and destructed last
GnuTLS::Init libinit;
- RandGen randhandler;
ProfileList profiles;
void ReadProfiles()
@@ -1352,7 +1351,7 @@ class ModuleSSLGnuTLS : public Module
{
ServerInstance->Logs->Log(MODNAME, LOG_DEFAULT, "GnuTLS lib version %s module was compiled for " GNUTLS_VERSION, gnutls_check_version(NULL));
ReadProfiles();
- ServerInstance->GenRandom = &randhandler;
+ ServerInstance->GenRandom = RandGen::Call;
}
void OnModuleRehash(User* user, const std::string &param) CXX11_OVERRIDE
@@ -1372,7 +1371,7 @@ class ModuleSSLGnuTLS : public Module
~ModuleSSLGnuTLS()
{
- ServerInstance->GenRandom = &ServerInstance->HandleGenRandom;
+ ServerInstance->GenRandom = &InspIRCd::DefaultGenRandom;
}
void OnCleanup(ExtensionItem::ExtensibleType type, Extensible* item) CXX11_OVERRIDE