summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Powell <petpow@saberuk.com>2017-08-13 16:26:48 +0100
committerPeter Powell <petpow@saberuk.com>2017-09-03 20:20:30 +0100
commite7c829af5941c6a8a303ca75ed9ac47570347e41 (patch)
treea40aa5b57346eb0b83e6f6b2cef1df36732800e5 /src
parent74dd288542e28f3604306cc69468f88b14c1b3c5 (diff)
Convert a bunch of time-related config options to getDuration.
Diffstat (limited to 'src')
-rw-r--r--src/configreader.cpp4
-rw-r--r--src/listensocket.cpp2
-rw-r--r--src/modules/extra/m_ldap.cpp2
-rw-r--r--src/modules/m_blockamsg.cpp2
-rw-r--r--src/modules/m_callerid.cpp2
-rw-r--r--src/modules/m_conn_join.cpp4
-rw-r--r--src/modules/m_connflood.cpp4
-rw-r--r--src/modules/m_flashpolicyd.cpp2
-rw-r--r--src/modules/m_httpd.cpp2
-rw-r--r--src/modules/m_ident.cpp2
-rw-r--r--src/modules/m_repeat.cpp2
-rw-r--r--src/modules/m_securelist.cpp2
-rw-r--r--src/modules/m_spanningtree/utils.cpp4
13 files changed, 17 insertions, 17 deletions
diff --git a/src/configreader.cpp b/src/configreader.cpp
index 220026155..f29356c0c 100644
--- a/src/configreader.cpp
+++ b/src/configreader.cpp
@@ -310,8 +310,8 @@ void ServerConfig::CrossCheckConnectBlocks(ServerConfig* current)
me->name = name;
- me->registration_timeout = tag->getInt("timeout", me->registration_timeout);
- me->pingtime = tag->getInt("pingfreq", me->pingtime);
+ me->registration_timeout = tag->getDuration("timeout", me->registration_timeout);
+ me->pingtime = tag->getDuration("pingfreq", me->pingtime);
std::string sendq;
if (tag->readString("sendq", sendq))
{
diff --git a/src/listensocket.cpp b/src/listensocket.cpp
index d09f5e624..dc588386d 100644
--- a/src/listensocket.cpp
+++ b/src/listensocket.cpp
@@ -74,7 +74,7 @@ ListenSocket::ListenSocket(ConfigTag* tag, const irc::sockets::sockaddrs& bind_t
rv = SocketEngine::Listen(this->fd, ServerInstance->Config->MaxConn);
// Default defer to on for TLS listeners because in TLS the client always speaks first
- int timeout = tag->getInt("defer", (tag->getString("ssl").empty() ? 0 : 3));
+ int timeout = tag->getDuration("defer", (tag->getString("ssl").empty() ? 0 : 3));
if (timeout && !rv)
{
#if defined TCP_DEFER_ACCEPT
diff --git a/src/modules/extra/m_ldap.cpp b/src/modules/extra/m_ldap.cpp
index fc1bee939..08d81e960 100644
--- a/src/modules/extra/m_ldap.cpp
+++ b/src/modules/extra/m_ldap.cpp
@@ -263,7 +263,7 @@ class LDAPService : public LDAPProvider, public SocketThread
searchscope = LDAP_SCOPE_ONELEVEL;
else
searchscope = LDAP_SCOPE_SUBTREE;
- timeout = config->getInt("timeout", 5);
+ timeout = config->getDuration("timeout", 5);
Connect();
}
diff --git a/src/modules/m_blockamsg.cpp b/src/modules/m_blockamsg.cpp
index 266497b90..7d97069f5 100644
--- a/src/modules/m_blockamsg.cpp
+++ b/src/modules/m_blockamsg.cpp
@@ -66,7 +66,7 @@ class ModuleBlockAmsg : public Module
void ReadConfig(ConfigStatus& status) CXX11_OVERRIDE
{
ConfigTag* tag = ServerInstance->Config->ConfValue("blockamsg");
- ForgetDelay = tag->getInt("delay", -1);
+ ForgetDelay = tag->getDuration("delay", -1);
std::string act = tag->getString("action");
if (act == "notice")
diff --git a/src/modules/m_callerid.cpp b/src/modules/m_callerid.cpp
index e11b326de..a00da6a6f 100644
--- a/src/modules/m_callerid.cpp
+++ b/src/modules/m_callerid.cpp
@@ -425,7 +425,7 @@ public:
cmd.maxaccepts = tag->getInt("maxaccepts", 16);
operoverride = tag->getBool("operoverride");
tracknick = tag->getBool("tracknick");
- notify_cooldown = tag->getInt("cooldown", 60);
+ notify_cooldown = tag->getDuration("cooldown", 60);
}
void Prioritize() CXX11_OVERRIDE
diff --git a/src/modules/m_conn_join.cpp b/src/modules/m_conn_join.cpp
index bd8d89dc9..7a06aedd3 100644
--- a/src/modules/m_conn_join.cpp
+++ b/src/modules/m_conn_join.cpp
@@ -75,7 +75,7 @@ class ModuleConnJoin : public Module
{
ConfigTag* tag = ServerInstance->Config->ConfValue("autojoin");
defchans = tag->getString("channel");
- defdelay = tag->getInt("delay", 0, 0, 60);
+ defdelay = tag->getDuration("delay", 0, 0, 60);
}
void Prioritize() CXX11_OVERRIDE
@@ -95,7 +95,7 @@ class ModuleConnJoin : public Module
return;
std::string chanlist = localuser->GetClass()->config->getString("autojoin");
- unsigned int chandelay = localuser->GetClass()->config->getInt("autojoindelay", 0, 0, 60);
+ unsigned int chandelay = localuser->GetClass()->config->getDuration("autojoindelay", 0, 0, 60);
if (chanlist.empty())
{
diff --git a/src/modules/m_connflood.cpp b/src/modules/m_connflood.cpp
index 2ab906e27..1d27e3990 100644
--- a/src/modules/m_connflood.cpp
+++ b/src/modules/m_connflood.cpp
@@ -46,9 +46,9 @@ public:
/* read configuration variables */
ConfigTag* tag = ServerInstance->Config->ConfValue("connflood");
/* throttle configuration */
- seconds = tag->getInt("seconds");
+ seconds = tag->getDuration("period", tag->getInt("seconds"));
maxconns = tag->getInt("maxconns");
- timeout = tag->getInt("timeout");
+ timeout = tag->getDuration("timeout");
quitmsg = tag->getString("quitmsg");
/* seconds to wait when the server just booted */
diff --git a/src/modules/m_flashpolicyd.cpp b/src/modules/m_flashpolicyd.cpp
index 38b7be73f..b44b72dbf 100644
--- a/src/modules/m_flashpolicyd.cpp
+++ b/src/modules/m_flashpolicyd.cpp
@@ -97,7 +97,7 @@ class ModuleFlashPD : public Module
void ReadConfig(ConfigStatus& status) CXX11_OVERRIDE
{
ConfigTag* tag = ServerInstance->Config->ConfValue("flashpolicyd");
- timeout = tag->getInt("timeout", 5, 1);
+ timeout = tag->getDuration("timeout", 5, 1);
std::string file = tag->getString("file");
if (!file.empty())
diff --git a/src/modules/m_httpd.cpp b/src/modules/m_httpd.cpp
index 35ae9abe5..961a70473 100644
--- a/src/modules/m_httpd.cpp
+++ b/src/modules/m_httpd.cpp
@@ -401,7 +401,7 @@ class ModuleHttpServer : public Module
void ReadConfig(ConfigStatus& status) CXX11_OVERRIDE
{
ConfigTag* tag = ServerInstance->Config->ConfValue("httpd");
- timeoutsec = tag->getInt("timeout", 10, 1);
+ timeoutsec = tag->getDuration("timeout", 10, 1);
}
ModResult OnAcceptConnection(int nfd, ListenSocket* from, irc::sockets::sockaddrs* client, irc::sockets::sockaddrs* server) CXX11_OVERRIDE
diff --git a/src/modules/m_ident.cpp b/src/modules/m_ident.cpp
index 0e5aa43ae..806c70ad2 100644
--- a/src/modules/m_ident.cpp
+++ b/src/modules/m_ident.cpp
@@ -271,7 +271,7 @@ class ModuleIdent : public Module
void ReadConfig(ConfigStatus& status) CXX11_OVERRIDE
{
ConfigTag* tag = ServerInstance->Config->ConfValue("ident");
- RequestTimeout = tag->getInt("timeout", 5, 1);
+ RequestTimeout = tag->getDuration("timeout", 5, 1);
NoLookupPrefix = tag->getBool("nolookupprefix", false);
}
diff --git a/src/modules/m_repeat.cpp b/src/modules/m_repeat.cpp
index 9715fcf6f..6c34648e0 100644
--- a/src/modules/m_repeat.cpp
+++ b/src/modules/m_repeat.cpp
@@ -233,7 +233,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->getInt("maxsecs", 0);
+ ms.MaxSecs = conf->getDuration("maxtime", conf->getInt("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 b925c3f37..e36b9e403 100644
--- a/src/modules/m_securelist.cpp
+++ b/src/modules/m_securelist.cpp
@@ -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")->getInt("waittime", 60);
+ WaitTime = ServerInstance->Config->ConfValue("securelist")->getDuration("waittime", 60);
}
diff --git a/src/modules/m_spanningtree/utils.cpp b/src/modules/m_spanningtree/utils.cpp
index c1c32e80a..79dc24e6a 100644
--- a/src/modules/m_spanningtree/utils.cpp
+++ b/src/modules/m_spanningtree/utils.cpp
@@ -229,8 +229,8 @@ void SpanningTreeUtilities::ReadConfiguration()
AnnounceTSChange = options->getBool("announcets");
AllowOptCommon = options->getBool("allowmismatch");
quiet_bursts = ServerInstance->Config->ConfValue("performance")->getBool("quietbursts");
- PingWarnTime = options->getInt("pingwarning");
- PingFreq = options->getInt("serverpingfreq");
+ PingWarnTime = options->getDuration("pingwarning");
+ PingFreq = options->getDuration("serverpingfreq");
if (PingFreq == 0)
PingFreq = 60;