+#else
+ // KQUEUE: We don't go through a loop to fill the fd_set so instead we must manually do this loop every now and again.
+ // TODO: We dont need to do all this EVERY loop iteration, tone down the visits to this if we're using kqueue.
+ while (count2 != clientlist.end())
+ {
+ if (count2 != clientlist.end())
+ {
+ curr = count2->second;
+ // we don't check the state of remote users.
+ if ((curr->fd != -1) && (curr->fd != FD_MAGIC_NUMBER))
+ {
+ // registration timeout -- didnt send USER/NICK/HOST in the time specified in
+ // their connection class.
+ if ((TIME > curr->timeout) && (curr->registered != 7))
+ {
+ log(DEBUG,"InspIRCd: registration timeout: %s",curr->nick);
+ kill_link(curr,"Registration timeout");
+ goto label;
+ }
+ if ((TIME > curr->signon) && (curr->registered == 3) && (AllModulesReportReady(curr)))
+ {
+ log(DEBUG,"signon exceed, registered=3, and modules ready, OK");
+ curr->dns_done = true;
+ statsDnsBad++;
+ FullConnectUser(curr);
+ goto label;
+ }
+ if ((curr->dns_done) && (curr->registered == 3) && (AllModulesReportReady(curr)))
+ {
+ log(DEBUG,"dns done, registered=3, and modules ready, OK");
+ FullConnectUser(curr);
+ goto label;
+ }
+ if ((TIME > curr->nping) && (isnick(curr->nick)) && (curr->registered == 7))
+ {
+ if ((!curr->lastping) && (curr->registered == 7))
+ {
+ log(DEBUG,"InspIRCd: ping timeout: %s",curr->nick);
+ kill_link(curr,"Ping timeout");
+ goto label;
+ }
+ Write(curr->fd,"PING :%s",ServerName);
+ log(DEBUG,"InspIRCd: pinging: %s",curr->nick);
+ curr->lastping = 0;
+ curr->nping = TIME+curr->pingmax; // was hard coded to 120
+ }
+ }
+ }
+ else break;
+ count2++;
+ }
+ // increment the counter right to the end of the list, as kqueue processes everything in one go
+#endif