Unconditionally set +6 flag on self.
[ircu2.10.12-pk.git] / ircd / ircd.c
index 8503d0ca7d33cd168ce61c189838a09cc5f4ede4..7048e7dcbadeee50d3533629eca39526c282ce27 100644 (file)
@@ -356,6 +356,24 @@ static void check_pings(struct Event* ev) {
           IsPingSent(cptr) ? "[Ping Sent]" : "[]", 
           max_ping, (int)(CurrentTime - cli_lasttime(cptr))));
 
+    /* If it's a server and we have not sent an AsLL lately, do so. */
+    if (IsServer(cptr)) {
+      if (CurrentTime - cli_serv(cptr)->asll_last >= max_ping) {
+        char *asll_ts;
+
+        SetPingSent(cptr);
+        cli_serv(cptr)->asll_last = CurrentTime;
+        expire = cli_serv(cptr)->asll_last + max_ping;
+        asll_ts = militime_float(NULL);
+        sendcmdto_prio_one(&me, CMD_PING, cptr, "!%s %s %s", asll_ts,
+                           cli_name(cptr), asll_ts);
+      }
+
+      expire = cli_serv(cptr)->asll_last + max_ping;
+      if (expire < next_check)
+        next_check = expire;
+    }
+
     /* Ok, the thing that will happen most frequently, is that someone will
      * have sent something recently.  Cover this first for speed.
      * -- 
@@ -418,11 +436,7 @@ static void check_pings(struct Event* ev) {
       if (IsUser(cptr))
         sendrawto_one(cptr, MSG_PING " :%s", cli_name(&me));
       else
-      {
-        char *asll_ts = militime_float(NULL);
-        sendcmdto_one(&me, CMD_PING, cptr, "!%s %s %s", asll_ts,
-                      cli_name(cptr), asll_ts);
-      }
+        sendcmdto_prio_one(&me, CMD_PING, cptr, ":%s", cli_name(&me));
     }
     
     expire = cli_lasttime(cptr) + max_ping * 2;
@@ -494,6 +508,9 @@ static void parse_command_line(int argc, char** argv) {
        debuglevel = 0;
       debugmode = optarg;
       thisServer.bootopt |= BOOT_DEBUG;
+#ifndef DEBUGMODE
+      printf("WARNING: DEBUGMODE disabled; -x has no effect.\n");
+#endif
       break;
 
     default:
@@ -735,6 +752,7 @@ int main(int argc, char **argv) {
   cli_lasttime(&me) = cli_since(&me) = cli_firsttime(&me) = CurrentTime;
 
   hAddClient(&me);
+  SetIPv6(&me);
 
   write_pidfile();
   init_counters();