diff options
author | Peter Powell <petpow@saberuk.com> | 2018-04-14 14:59:35 +0100 |
---|---|---|
committer | Peter Powell <petpow@saberuk.com> | 2018-04-16 15:24:49 +0100 |
commit | 2d36fcb16ef3209fffbe9f4b600971a1edd2ae4b (patch) | |
tree | 4e8f371548bfbc844ad7db42b775db847b141636 /src/modules | |
parent | ccab908f14804776aab4c6728710e89b4847130a (diff) |
Convert ConfigTag::getDuration to return an unsigned long.
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/m_blockamsg.cpp | 6 | ||||
-rw-r--r-- | src/modules/m_connflood.cpp | 8 | ||||
-rw-r--r-- | src/modules/m_dnsbl.cpp | 2 | ||||
-rw-r--r-- | src/modules/m_ircv3_sts.cpp | 2 | ||||
-rw-r--r-- | src/modules/m_repeat.cpp | 2 | ||||
-rw-r--r-- | src/modules/m_securelist.cpp | 4 |
6 files changed, 13 insertions, 11 deletions
diff --git a/src/modules/m_blockamsg.cpp b/src/modules/m_blockamsg.cpp index 7d97069f5..ed0e486e9 100644 --- a/src/modules/m_blockamsg.cpp +++ b/src/modules/m_blockamsg.cpp @@ -48,7 +48,7 @@ class BlockedMessage class ModuleBlockAmsg : public Module { - int ForgetDelay; + unsigned int ForgetDelay; BlockAction action; SimpleExtItem<BlockedMessage> blockamsg; @@ -66,7 +66,7 @@ class ModuleBlockAmsg : public Module void ReadConfig(ConfigStatus& status) CXX11_OVERRIDE { ConfigTag* tag = ServerInstance->Config->ConfValue("blockamsg"); - ForgetDelay = tag->getDuration("delay", -1); + ForgetDelay = tag->getDuration("delay", 3); std::string act = tag->getString("action"); if (act == "notice") @@ -116,7 +116,7 @@ class ModuleBlockAmsg : public Module // OR // The number of target channels is equal to the number of channels the sender is on..a little suspicious. // Check it's more than 1 too, or else users on one channel would have fun. - if ((m && (m->message == parameters[1]) && (!irc::equals(m->target, parameters[0])) && (ForgetDelay != -1) && (m->sent >= ServerInstance->Time()-ForgetDelay)) || ((targets > 1) && (targets == user->chans.size()))) + if ((m && (m->message == parameters[1]) && (!irc::equals(m->target, parameters[0])) && ForgetDelay && (m->sent >= ServerInstance->Time()-ForgetDelay)) || ((targets > 1) && (targets == user->chans.size()))) { // Block it... if (action == IBLOCK_KILLOPERS || action == IBLOCK_NOTICEOPERS) diff --git a/src/modules/m_connflood.cpp b/src/modules/m_connflood.cpp index 29d4d9d3a..32d36188b 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; @@ -46,13 +48,13 @@ public: /* read configuration variables */ ConfigTag* tag = ServerInstance->Config->ConfValue("connflood"); /* throttle configuration */ - seconds = tag->getDuration("period", tag->getInt("seconds", 30)); + seconds = tag->getDuration("period", tag->getDuration("seconds", 30)); maxconns = tag->getInt("maxconns", 3); timeout = tag->getDuration("timeout", 30); quitmsg = tag->getString("quitmsg"); /* seconds to wait when the server just booted */ - boot_wait = tag->getInt("bootwait", 10); + boot_wait = tag->getDuration("bootwait", 10); first = ServerInstance->Time(); } diff --git a/src/modules/m_dnsbl.cpp b/src/modules/m_dnsbl.cpp index ed31cc54a..377cad9dd 100644 --- a/src/modules/m_dnsbl.cpp +++ b/src/modules/m_dnsbl.cpp @@ -35,7 +35,7 @@ class DNSBLConfEntry : public refcountbase std::string name, ident, host, domain, reason; EnumBanaction banaction; EnumType type; - long duration; + unsigned long duration; unsigned int bitmask; unsigned char records[256]; unsigned long stats_hits, stats_misses; diff --git a/src/modules/m_ircv3_sts.cpp b/src/modules/m_ircv3_sts.cpp index f3b936b41..9dc36df60 100644 --- a/src/modules/m_ircv3_sts.cpp +++ b/src/modules/m_ircv3_sts.cpp @@ -167,7 +167,7 @@ class ModuleIRCv3STS : public Module if (!HasValidSSLPort(port)) throw ModuleException("<sts:port> must be a TLS port, at " + tag->getTagLocation()); - unsigned long duration = tag->getDuration("duration", 60*60*24*30*2, 0, LONG_MAX); + unsigned long duration = tag->getDuration("duration", 60*60*24*30*2); bool preload = tag->getBool("preload"); cap.SetPolicy(host, duration, port, preload); } diff --git a/src/modules/m_repeat.cpp b/src/modules/m_repeat.cpp index 7ecdf21dc..18732d705 100644 --- a/src/modules/m_repeat.cpp +++ b/src/modules/m_repeat.cpp @@ -235,7 +235,7 @@ class RepeatMode : public ParamMode<RepeatMode, SimpleExtItem<ChannelSettings> > ConfigTag* conf = ServerInstance->Config->ConfValue("repeat"); ms.MaxLines = conf->getInt("maxlines", 20); ms.MaxBacklog = conf->getInt("maxbacklog", 20); - ms.MaxSecs = conf->getDuration("maxtime", conf->getInt("maxsecs", 0)); + ms.MaxSecs = conf->getDuration("maxtime", conf->getDuration("maxsecs", 0)); ms.MaxDiff = conf->getInt("maxdistance", 50); if (ms.MaxDiff > 100) diff --git a/src/modules/m_securelist.cpp b/src/modules/m_securelist.cpp index e36b9e403..71788a835 100644 --- a/src/modules/m_securelist.cpp +++ b/src/modules/m_securelist.cpp @@ -24,7 +24,7 @@ class ModuleSecureList : public Module { std::vector<std::string> allowlist; - time_t WaitTime; + unsigned int WaitTime; public: Version GetVersion() CXX11_OVERRIDE @@ -40,7 +40,7 @@ class ModuleSecureList : public Module for (ConfigIter i = tags.first; i != tags.second; ++i) allowlist.push_back(i->second->getString("exception")); - WaitTime = ServerInstance->Config->ConfValue("securelist")->getDuration("waittime", 60); + WaitTime = ServerInstance->Config->ConfValue("securelist")->getDuration("waittime", 60, 1); } |