From 02340285c564a7e82105137192d46d554a6fce3a Mon Sep 17 00:00:00 2001 From: Dominic Hamon Date: Sun, 30 May 2021 20:37:54 +0100 Subject: Added -Wshorten-64-to-32 and fixed all warnings. --- src/modules/m_connflood.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/modules/m_connflood.cpp') diff --git a/src/modules/m_connflood.cpp b/src/modules/m_connflood.cpp index 23aa178ea..0cb944e04 100644 --- a/src/modules/m_connflood.cpp +++ b/src/modules/m_connflood.cpp @@ -28,11 +28,11 @@ class ModuleConnFlood : public Module { private: - unsigned int seconds; - unsigned int timeout; - unsigned int boot_wait; - unsigned int conns = 0; - unsigned int maxconns; + unsigned long seconds; + unsigned long timeout; + unsigned long boot_wait; + unsigned long conns = 0; + unsigned long maxconns; bool throttled = false; time_t first; std::string quitmsg; @@ -76,7 +76,7 @@ class ModuleConnFlood : public Module time_t next = ServerInstance->Time(); - if ((ServerInstance->startup_time + boot_wait) > next) + if (time_t(ServerInstance->startup_time + boot_wait) > next) return MOD_RES_PASSTHRU; /* time difference between first and latest connection */ @@ -87,7 +87,7 @@ class ModuleConnFlood : public Module if (throttled) { - if (tdiff > seconds + timeout) + if (tdiff > time_t(seconds + timeout)) { /* expire throttle */ throttled = false; @@ -99,7 +99,7 @@ class ModuleConnFlood : public Module return MOD_RES_DENY; } - if (tdiff <= seconds) + if (tdiff <= time_t(seconds)) { if (conns >= maxconns) { -- cgit v1.3.1-10-gc9f91