]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/inspircd.cpp
Added helperfuncs.h
[user/henk/code/inspircd.git] / src / inspircd.cpp
index 1a12b7039cbe27df6bf22cc782c71bd7c7d5cdb2..66f15e8729a446af94c14e19f0b366b43f29198c 100644 (file)
@@ -70,9 +70,6 @@
 
 InspIRCd* ServerInstance;
 
-int WHOWAS_STALE = 48; // default WHOWAS Entries last 2 days before they go 'stale'
-int WHOWAS_MAX = 100;  // default 100 people maximum in the WHOWAS list
-
 extern ModuleList modules;
 extern FactoryList factory;
 
@@ -81,12 +78,9 @@ std::vector<userrec*> local_users;
 
 extern int MODCOUNT;
 extern char LOG_FILE[MAXBUF];
-int openSockfd[MAX_DESCRIPTORS];
-int yield_depth;
 int iterations = 0;
 
 insp_sockaddr client, server;
-
 socklen_t length;
 
 extern InspSocket* socket_ref[MAX_DESCRIPTORS];
@@ -246,6 +240,7 @@ InspIRCd::InspIRCd(int argc, char** argv)
 {
        this->Start();
        module_sockets.clear();
+       init_dns();
        this->startup_time = time(NULL);
        srand(time(NULL));
        log(DEBUG,"*** InspIRCd starting up!");
@@ -694,11 +689,6 @@ void InspIRCd::DoOneIteration(bool process_module_sockets)
        insp_sockaddr sock_us;     // our port number
        socklen_t uslen;         // length of our port number
 
-       if (yield_depth > 100)
-               return;
-
-       yield_depth++;
-
        /* time() seems to be a pretty expensive syscall, so avoid calling it too much.
         * Once per loop iteration is pleanty.
         */
@@ -731,7 +721,6 @@ void InspIRCd::DoOneIteration(bool process_module_sockets)
                }
                TickMissedTimers(TIME);
                expire_run = true;
-               yield_depth--;
                return;
        }   
        else if ((TIME % 5) == 1)
@@ -772,10 +761,7 @@ void InspIRCd::DoOneIteration(bool process_module_sockets)
         * servers... so its nice and easy, just one call.
         */
        if (!(numberactive = SE->Wait(activefds)))
-       {
-               yield_depth--;
                return;
-       }
 
        /**
         * Now process each of the fd's. For users, we have a fast
@@ -851,6 +837,15 @@ void InspIRCd::DoOneIteration(bool process_module_sockets)
 #endif
                        break;
 
+                       case X_ESTAB_CLASSDNS:
+                               /* Handles instances of the Resolver class,
+                                * a simple class extended by modules for
+                                * nonblocking resolving of addresses.
+                                */
+
+                               dns_deal_with_classes(activefds[activefd]);
+                       break;
+
                        case X_LISTEN:
 
                                log(DEBUG,"Type: X_LISTEN_MODULE: fd=%d",activefds[activefd]);
@@ -904,7 +899,6 @@ void InspIRCd::DoOneIteration(bool process_module_sockets)
                        break;
                }
        }
-       yield_depth--;
 }
 
 int InspIRCd::Run()
@@ -929,13 +923,12 @@ int InspIRCd::Run()
         * to the socket engine
         */
        for (int count = 0; count < stats->BoundPortCount; count++)
-               SE->AddFd(openSockfd[count],true,X_LISTEN);
+               SE->AddFd(Config->openSockfd[count],true,X_LISTEN);
 
        this->WritePID(Config->PID);
 
        /* main loop, this never returns */
        expire_run = false;
-       yield_depth = 0;
        iterations = 0;
 
        while (true)