From cd6784021f39d09ab6b29261e43aea5fd96cc00c Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Sun, 6 Aug 2023 00:50:05 +0100 Subject: Make config file cache invalidation more useful. --- src/modules/extra/m_ssl_gnutls.cpp | 7 +------ src/modules/extra/m_ssl_mbedtls.cpp | 7 +------ 2 files changed, 2 insertions(+), 12 deletions(-) (limited to 'src/modules') diff --git a/src/modules/extra/m_ssl_gnutls.cpp b/src/modules/extra/m_ssl_gnutls.cpp index 181e6bd49..f814e8ec4 100644 --- a/src/modules/extra/m_ssl_gnutls.cpp +++ b/src/modules/extra/m_ssl_gnutls.cpp @@ -65,8 +65,6 @@ static Module* thismod; namespace GnuTLS { - time_t lastrehash = 0; - void GenRandom(char* buffer, size_t len) { gnutls_rnd(GNUTLS_RND_RANDOM, buffer, len); @@ -487,7 +485,7 @@ namespace GnuTLS static std::string ReadFile(const std::string& filename) { - auto file = ServerInstance->Config->ReadFile(filename, GnuTLS::lastrehash != ServerInstance->Time()); + auto file = ServerInstance->Config->ReadFile(filename, ServerInstance->Time()); if (!file) throw Exception("Cannot read file " + filename + ": " + file.error); return file.contents; @@ -1125,9 +1123,6 @@ class ModuleSSLGnuTLS final void ReadProfiles() { - // Invalidate the filesystem cache. - GnuTLS::lastrehash = ServerInstance->Time(); - // First, store all profiles in a new, temporary container. If no problems occur, swap the two // containers; this way if something goes wrong we can go back and continue using the current profiles, // avoiding unpleasant situations where no new TLS connections are possible. diff --git a/src/modules/extra/m_ssl_mbedtls.cpp b/src/modules/extra/m_ssl_mbedtls.cpp index c2309ea28..2a628a3e9 100644 --- a/src/modules/extra/m_ssl_mbedtls.cpp +++ b/src/modules/extra/m_ssl_mbedtls.cpp @@ -56,8 +56,6 @@ static Module* thismod; namespace mbedTLS { - time_t lastrehash = 0; - class Exception final : public ModuleException { @@ -524,7 +522,7 @@ namespace mbedTLS static std::string ReadFile(const std::string& filename) { - auto file = ServerInstance->Config->ReadFile(filename, mbedTLS::lastrehash != ServerInstance->Time()); + auto file = ServerInstance->Config->ReadFile(filename, ServerInstance->Time()); if (!file) throw Exception("Cannot read file " + filename + ": " + file.error); return file.contents; @@ -922,9 +920,6 @@ private: void ReadProfiles() { - // Invalidate the filesystem cache. - mbedTLS::lastrehash = ServerInstance->Time(); - // First, store all profiles in a new, temporary container. If no problems occur, swap the two // containers; this way if something goes wrong we can go back and continue using the current profiles, // avoiding unpleasant situations where no new TLS connections are possible. -- cgit v1.3.1-10-gc9f91