]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/inspircd.cpp
Align names that are output on startup using \t htabs
[user/henk/code/inspircd.git] / src / inspircd.cpp
index eae26c64e8f01833fb057a4a27e178d46cd9c928..9b48d83ef4dc85b5efa2af17c96490f3a1169aba 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
@@ -763,7 +773,7 @@ void InspIRCd::DoOneIteration(bool process_module_sockets)
                                                 }
                                                 catch (ModuleException& modexcept)
                                                 {
-                                                        log(DEBUG,"Module exception cought: %s",modexcept.GetReason()); \
+                                                        log(DEBUG,"Module exception cought: %s",modexcept.GetReason());
                                                 }
                                         }
                                         stats->statsAccept++;
@@ -785,6 +795,7 @@ void InspIRCd::DoOneIteration(bool process_module_sockets)
                                  * what we would do, so for now, its going
                                  * to safely do bugger all.
                                  */
+                               SE->DelFd(activefds[activefd]);
                         break;
                 }
         }
@@ -801,8 +812,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 +828,7 @@ int InspIRCd::Run()
        /* main loop, this never returns */
        expire_run = false;
        yield_depth = 0;
+       iterations = 0;
 
        while (true)
        {