diff options
| author | 2021-05-30 20:37:54 +0100 | |
|---|---|---|
| committer | 2021-05-30 20:37:54 +0100 | |
| commit | 02340285c564a7e82105137192d46d554a6fce3a (patch) | |
| tree | 696d1a6249841de62c3fed70310c2a347fc66732 /src/modules/m_connflood.cpp | |
| parent | Add a workaround for a bug in GitHub Actions. (diff) | |
Added -Wshorten-64-to-32 and fixed all warnings.
Diffstat (limited to 'src/modules/m_connflood.cpp')
| -rw-r--r-- | src/modules/m_connflood.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
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) { |
