X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_connflood.cpp;h=5070dd3a76b26e6e629f71b4415451e104c43ca3;hb=43e31bba5429849fdebeddc65f7e6f267211181f;hp=23b570bf6007b85af20998d66b05be65584742b6;hpb=1031f333332cf1b09db4fd632f141143ee637c34;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_connflood.cpp b/src/modules/m_connflood.cpp index 23b570bf6..5070dd3a7 100644 --- a/src/modules/m_connflood.cpp +++ b/src/modules/m_connflood.cpp @@ -23,7 +23,9 @@ class ModuleConnFlood : public Module { - int seconds, timeout, boot_wait; + unsigned int seconds; + unsigned int timeout; + unsigned int boot_wait; unsigned int conns; unsigned int maxconns; bool throttled; @@ -36,28 +38,23 @@ public: { } - void init() CXX11_OVERRIDE - { - InitConf(); - } - Version GetVersion() CXX11_OVERRIDE { return Version("Connection throttle", VF_VENDOR); } - void InitConf() + void ReadConfig(ConfigStatus& status) CXX11_OVERRIDE { /* read configuration variables */ ConfigTag* tag = ServerInstance->Config->ConfValue("connflood"); /* throttle configuration */ - seconds = tag->getInt("seconds"); - maxconns = tag->getInt("maxconns"); - timeout = tag->getInt("timeout"); + seconds = tag->getDuration("period", tag->getDuration("seconds", 30)); + maxconns = tag->getUInt("maxconns", 3); + timeout = tag->getDuration("timeout", 30); quitmsg = tag->getString("quitmsg"); /* seconds to wait when the server just booted */ - boot_wait = tag->getInt("bootwait"); + boot_wait = tag->getDuration("bootwait", 10); first = ServerInstance->Time(); } @@ -109,12 +106,6 @@ public: } return MOD_RES_PASSTHRU; } - - void OnRehash(User* user) CXX11_OVERRIDE - { - InitConf(); - } - }; MODULE_INIT(ModuleConnFlood)