]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/inspircd.cpp
Strlen bashing.
[user/henk/code/inspircd.git] / src / inspircd.cpp
index eae26c64e8f01833fb057a4a27e178d46cd9c928..ea035e7b04b54df5457cab1c64210edda96b79fc 100644 (file)
@@ -73,6 +73,7 @@ extern int MODCOUNT;
 extern char LOG_FILE[MAXBUF];
 int openSockfd[MAXSOCKS];
 int yield_depth;
+int iterations = 0;
 sockaddr_in client,server;
 socklen_t length;
 
@@ -90,7 +91,7 @@ ServerConfig *Config = new ServerConfig;
 
 user_hash clientlist;
 chan_hash chanlist;
-whowas_hash whowas;
+
 servernamelist servernames;
 char lowermap[255];
 
@@ -647,13 +648,22 @@ void InspIRCd::DoOneIteration(bool process_module_sockets)
         {
                 expire_run = false;
         }
+
+       if (iterations++ == 15)
+       {
+               iterations = 0;
+               DoBackgroundUserStuff(TIME);
+       }
  
         /* Once a second, do the background processing */
         if (TIME != OLDTIME)
         {
                 if (TIME < OLDTIME)
                         WriteOpers("*** \002EH?!\002 -- Time is flowing BACKWARDS in this dimension! Clock drifted backwards %d secs.",abs(OLDTIME-TIME));
-                DoBackgroundUserStuff(TIME);
+               if ((TIME % 3600) == 0)
+               {
+                       MaintainWhoWas(TIME);
+               }
         }
 
         /* Process timeouts on module sockets each time around
@@ -801,8 +811,9 @@ int InspIRCd::Run()
        
        if (!Config->nofork)
        {
-               freopen("/dev/null","w",stdout);
-               freopen("/dev/null","w",stderr);
+               fclose(stdout);
+               fclose(stderr);
+               fclose(stdin);
        }
 
        /* Add the listening sockets used for client inbound connections
@@ -816,6 +827,7 @@ int InspIRCd::Run()
        /* main loop, this never returns */
        expire_run = false;
        yield_depth = 0;
+       iterations = 0;
 
        while (true)
        {