]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/timer.cpp
Add timeouts to the http module. Two seperate timeouts, 60 seconds to receive headers...
[user/henk/code/inspircd.git] / src / timer.cpp
index 2b30b478cf592eed5806b27d8d137449fb125cf9..bc08ae1d015f1238017bec1b5e76c595aebafea8 100644 (file)
  * ---------------------------------------------------
  */
 
-#include <vector>
-#include <map>
-#include "inspircd_config.h"
 #include "inspircd.h"
-#include "typedefs.h"
-#include "helperfuncs.h"
 #include "timer.h"
 
 void TimerManager::TickTimers(time_t TIME)
@@ -44,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,