From 4935ef4d2687a7d4f56a21b11f4ae70994d7b8c3 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Wed, 25 Feb 2015 09:34:27 +0100 Subject: [PATCH 1/2] Fix compilation warning when HAVE_LIBSSL is not defined Building core object Socket... src/Socket.cpp:30:16: warning: unused function 'ZNC_DefaultCipher' [-Wunused-function] static CString ZNC_DefaultCipher() { ^ 1 warning generated. --- src/Socket.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Socket.cpp b/src/Socket.cpp index 49185299..6870e492 100644 --- a/src/Socket.cpp +++ b/src/Socket.cpp @@ -26,6 +26,7 @@ #include #endif +#ifdef HAVE_LIBSSL // Copypasted from https://wiki.mozilla.org/Security/Server_Side_TLS#Intermediate_compatibility_.28default.29 at 22 Dec 2014 static CString ZNC_DefaultCipher() { return @@ -36,6 +37,7 @@ static CString ZNC_DefaultCipher() { "DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:" "AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA"; } +#endif CZNCSock::CZNCSock(int timeout) : Csock(timeout) { #ifdef HAVE_LIBSSL From 1180467a87fc9cce832561566b29c154925e9167 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Sat, 28 Feb 2015 21:15:23 +0100 Subject: [PATCH 2/2] Fix chansaver loading CModules::LoadModule() sets the module type _after_ construction. The constructor cannot therefore do actions based on the module type. Move loading to OnLoad(). --- modules/chansaver.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/modules/chansaver.cpp b/modules/chansaver.cpp index 9f54cad8..90a623e6 100644 --- a/modules/chansaver.cpp +++ b/modules/chansaver.cpp @@ -21,6 +21,12 @@ class CChanSaverMod : public CModule { public: MODCONSTRUCTOR(CChanSaverMod) { + } + + virtual ~CChanSaverMod() { + } + + bool OnLoad(const CString& sArgsi, CString& sMessage) override { switch (GetType()) { case CModInfo::GlobalModule: LoadUsers(); @@ -32,9 +38,7 @@ public: LoadNetwork(GetNetwork()); break; } - } - - virtual ~CChanSaverMod() { + return true; } void LoadUsers() {