From 383caa90d568d8d997a9624a9e6174ddc1a9a3da Mon Sep 17 00:00:00 2001 From: brain Date: Fri, 15 Sep 2006 18:36:38 +0000 Subject: Add timeouts to the http module. Two seperate timeouts, 60 seconds to receive headers, and 60 seconds after receipt of headers and sending of page, in which to time out the connection if the client doesnt close() as it should git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5260 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/timer.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'src/timer.cpp') diff --git a/src/timer.cpp b/src/timer.cpp index 9157c1521..bc08ae1d0 100644 --- a/src/timer.cpp +++ b/src/timer.cpp @@ -39,6 +39,28 @@ void TimerManager::TickTimers(time_t TIME) } } +void TimerManager::DelTimer(InspTimer* T) +{ + timerlist::iterator found = Timers.find(T->GetTimer()); + + if (found != Timers.end()) + { + timergroup* x = found->second; + for (timergroup::iterator y = x->begin(); y != x->end(); y++) + { + InspTimer* n = *y; + if (n == T) + { + DELETE(n); + x->erase(y); + if (!x->size()) + Timers.erase(found); + return; + } + } + } +} + /* * Because some muppets may do odd things, and their ircd may lock up due * to crappy 3rd party modules, or they may change their system time a bit, -- cgit v1.2.3