summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAttila Molnar <attilamolnar@hush.com>2014-07-10 12:17:55 +0200
committerAttila Molnar <attilamolnar@hush.com>2014-07-10 12:17:55 +0200
commitacccaa39641500b8a691db4136e6571102a438ed (patch)
tree5faed16f0fc7ac11566d6df19561abd3c3ad8c43
parent8186e0b091a4f487448dcfab7144217a85870d4c (diff)
Remove current time parameter of the Timer constructor
-rw-r--r--include/inspsocket.h2
-rw-r--r--include/modules/dns.h2
-rw-r--r--include/timer.h3
-rw-r--r--src/coremods/core_dns.cpp2
-rw-r--r--src/inspsocket.cpp2
-rw-r--r--src/modules/extra/m_pgsql.cpp2
-rw-r--r--src/modules/m_conn_join.cpp2
-rw-r--r--src/modules/m_spanningtree/resolvers.cpp2
-rw-r--r--src/timer.cpp4
9 files changed, 10 insertions, 11 deletions
diff --git a/include/inspsocket.h b/include/inspsocket.h
index 720489b77..1bcfbea09 100644
--- a/include/inspsocket.h
+++ b/include/inspsocket.h
@@ -90,7 +90,7 @@ class CoreExport SocketTimeout : public Timer
* @param secs_from_now Seconds from now to time out
* @param now The current time
*/
- SocketTimeout(int fd, BufferedSocket* thesock, long secs_from_now, time_t now) : Timer(secs_from_now, now), sock(thesock), sfd(fd) { }
+ SocketTimeout(int fd, BufferedSocket* thesock, long secs_from_now) : Timer(secs_from_now), sock(thesock), sfd(fd) { }
/** Handle tick event
*/
diff --git a/include/modules/dns.h b/include/modules/dns.h
index c76c53805..400d2085d 100644
--- a/include/modules/dns.h
+++ b/include/modules/dns.h
@@ -152,7 +152,7 @@ namespace DNS
Module* const creator;
Request(Manager* mgr, Module* mod, const std::string& addr, QueryType qt, bool usecache = true)
- : Timer((ServerInstance->Config->dns_timeout ? ServerInstance->Config->dns_timeout : 5), ServerInstance->Time())
+ : Timer((ServerInstance->Config->dns_timeout ? ServerInstance->Config->dns_timeout : 5))
, Question(addr, qt)
, manager(mgr)
, use_cache(usecache)
diff --git a/include/timer.h b/include/timer.h
index 1787da7ba..2ac0517b8 100644
--- a/include/timer.h
+++ b/include/timer.h
@@ -50,10 +50,9 @@ class CoreExport Timer
public:
/** Default constructor, initializes the triggering time
* @param secs_from_now The number of seconds from now to trigger the timer
- * @param now The time now
* @param repeating Repeat this timer every secs_from_now seconds if set to true
*/
- Timer(unsigned int secs_from_now, time_t now, bool repeating = false);
+ Timer(unsigned int secs_from_now, bool repeating = false);
/** Default destructor, removes the timer from the timer manager
*/
diff --git a/src/coremods/core_dns.cpp b/src/coremods/core_dns.cpp
index 17e489794..f6a1da8c9 100644
--- a/src/coremods/core_dns.cpp
+++ b/src/coremods/core_dns.cpp
@@ -444,7 +444,7 @@ class MyManager : public Manager, public Timer, public EventHandler
public:
DNS::Request* requests[MAX_REQUEST_ID];
- MyManager(Module* c) : Manager(c), Timer(3600, ServerInstance->Time(), true)
+ MyManager(Module* c) : Manager(c), Timer(3600, true)
{
for (int i = 0; i < MAX_REQUEST_ID; ++i)
requests[i] = NULL;
diff --git a/src/inspsocket.cpp b/src/inspsocket.cpp
index eb59bf4f1..494422075 100644
--- a/src/inspsocket.cpp
+++ b/src/inspsocket.cpp
@@ -107,7 +107,7 @@ BufferedSocketError BufferedSocket::BeginConnect(const irc::sockets::sockaddrs&
if (!SocketEngine::AddFd(this, FD_WANT_NO_READ | FD_WANT_SINGLE_WRITE | FD_WRITE_WILL_BLOCK))
return I_ERR_NOMOREFDS;
- this->Timeout = new SocketTimeout(this->GetFd(), this, timeout, ServerInstance->Time());
+ this->Timeout = new SocketTimeout(this->GetFd(), this, timeout);
ServerInstance->Timers.AddTimer(this->Timeout);
ServerInstance->Logs->Log("SOCKET", LOG_DEBUG, "BufferedSocket::DoConnect success");
diff --git a/src/modules/extra/m_pgsql.cpp b/src/modules/extra/m_pgsql.cpp
index 1f7d7c450..b89633ede 100644
--- a/src/modules/extra/m_pgsql.cpp
+++ b/src/modules/extra/m_pgsql.cpp
@@ -57,7 +57,7 @@ class ReconnectTimer : public Timer
private:
ModulePgSQL* mod;
public:
- ReconnectTimer(ModulePgSQL* m) : Timer(5, ServerInstance->Time(), false), mod(m)
+ ReconnectTimer(ModulePgSQL* m) : Timer(5, false), mod(m)
{
}
bool Tick(time_t TIME);
diff --git a/src/modules/m_conn_join.cpp b/src/modules/m_conn_join.cpp
index 631e5945c..d5a095e7f 100644
--- a/src/modules/m_conn_join.cpp
+++ b/src/modules/m_conn_join.cpp
@@ -43,7 +43,7 @@ class JoinTimer : public Timer
public:
JoinTimer(LocalUser* u, SimpleExtItem<JoinTimer>& ex, const std::string& chans, unsigned int delay)
- : Timer(delay, ServerInstance->Time(), false)
+ : Timer(delay, false)
, user(u), channels(chans), ext(ex)
{
ServerInstance->Timers.AddTimer(this);
diff --git a/src/modules/m_spanningtree/resolvers.cpp b/src/modules/m_spanningtree/resolvers.cpp
index 80e8aeb0e..3d04a5085 100644
--- a/src/modules/m_spanningtree/resolvers.cpp
+++ b/src/modules/m_spanningtree/resolvers.cpp
@@ -128,7 +128,7 @@ void SecurityIPResolver::OnError(const DNS::Query *r)
}
CacheRefreshTimer::CacheRefreshTimer()
- : Timer(3600, ServerInstance->Time(), true)
+ : Timer(3600, true)
{
}
diff --git a/src/timer.cpp b/src/timer.cpp
index 4fee71742..0b0d8bac3 100644
--- a/src/timer.cpp
+++ b/src/timer.cpp
@@ -30,8 +30,8 @@ void Timer::SetInterval(time_t newinterval)
ServerInstance->Timers.AddTimer(this);
}
-Timer::Timer(unsigned int secs_from_now, time_t now, bool repeating)
- : trigger(now + secs_from_now)
+Timer::Timer(unsigned int secs_from_now, bool repeating)
+ : trigger(ServerInstance->Time() + secs_from_now)
, secs(secs_from_now)
, repeat(repeating)
{