Author: Isomer <isomer@coders.net>
[ircu2.10.12-pk.git] / ircd / list.c
index bc44e6325304fabfe02e57281251b3a2e95557c3..fb86192e2b9ea85bd776038586eefcdec9f646f3 100644 (file)
@@ -25,6 +25,7 @@
 #include "client.h"
 #include "ircd.h"
 #include "ircd_alloc.h"
+#include "ircd_reply.h"
 #include "ircd_string.h"
 #include "listener.h"
 #include "match.h"
@@ -125,8 +126,10 @@ void free_client(struct Client *cptr)
      */
     if (cptr->dns_reply)
       --cptr->dns_reply->ref_count;
-    if (-1 < cptr->fd)
+    if (-1 < cptr->fd) {
+      ip_registry_local_disconnect(cptr);
       close(cptr->fd);
+    }
     DBufClear(&cptr->sendQ);
     DBufClear(&cptr->recvQ);
     if (cptr->listener)
@@ -153,7 +156,7 @@ struct Server *make_server(struct Client *cptr)
     servs.inuse++;
 #endif
     cptr->serv = serv;
-    cptr->serv->lag = 10000;
+    cptr->serv->lag = 60000;
     *serv->by = '\0';
     DupString(serv->last_error_msg, "<>");      /* String must be non-empty */
   }
@@ -314,42 +317,35 @@ void send_listinfo(struct Client *cptr, char *name)
 {
   int inuse = 0, mem = 0, tmp = 0;
 
-  sendto_one(cptr, ":%s %d %s :Local: inuse: %d(%d)",
-      me.name, RPL_STATSDEBUG, name, inuse += cloc.inuse,
-      tmp = cloc.inuse * CLIENT_LOCAL_SIZE);
+  send_reply(cptr, SND_EXPLICIT | RPL_STATSDEBUG, ":Local: inuse: %d(%d)",
+            inuse += cloc.inuse, tmp = cloc.inuse * CLIENT_LOCAL_SIZE);
   mem += tmp;
-  sendto_one(cptr, ":%s %d %s :Remote: inuse: %d(%d)",
-      me.name, RPL_STATSDEBUG, name,
-      crem.inuse, tmp = crem.inuse * CLIENT_REMOTE_SIZE);
+  send_reply(cptr, SND_EXPLICIT | RPL_STATSDEBUG, ":Remote: inuse: %d(%d)",
+            crem.inuse, tmp = crem.inuse * CLIENT_REMOTE_SIZE);
   mem += tmp;
   inuse += crem.inuse;
-  sendto_one(cptr, ":%s %d %s :Users: inuse: %d(%d)",
-      me.name, RPL_STATSDEBUG, name, users.inuse,
-      tmp = users.inuse * sizeof(struct User));
+  send_reply(cptr, SND_EXPLICIT | RPL_STATSDEBUG, ":Users: inuse: %d(%d)",
+            users.inuse, tmp = users.inuse * sizeof(struct User));
   mem += tmp;
-  inuse += users.inuse,
-      sendto_one(cptr, ":%s %d %s :Servs: inuse: %d(%d)",
-      me.name, RPL_STATSDEBUG, name, servs.inuse,
-      tmp = servs.inuse * sizeof(struct Server));
+  inuse += users.inuse;
+  send_reply(cptr, SND_EXPLICIT | RPL_STATSDEBUG, ":Servs: inuse: %d(%d)",
+            servs.inuse, tmp = servs.inuse * sizeof(struct Server));
   mem += tmp;
-  inuse += servs.inuse,
-      sendto_one(cptr, ":%s %d %s :Links: inuse: %d(%d)",
-      me.name, RPL_STATSDEBUG, name, links.inuse,
-      tmp = links.inuse * sizeof(struct SLink));
+  inuse += servs.inuse;
+  send_reply(cptr, SND_EXPLICIT | RPL_STATSDEBUG, ":Links: inuse: %d(%d)",
+            links.inuse, tmp = links.inuse * sizeof(struct SLink));
   mem += tmp;
-  inuse += links.inuse,
-      sendto_one(cptr, ":%s %d %s :Classes: inuse: %d(%d)",
-      me.name, RPL_STATSDEBUG, name, classs.inuse,
-      tmp = classs.inuse * sizeof(struct ConfClass));
+  inuse += links.inuse;
+  send_reply(cptr, SND_EXPLICIT | RPL_STATSDEBUG, ":Classes: inuse: %d(%d)",
+            classs.inuse, tmp = classs.inuse * sizeof(struct ConfClass));
   mem += tmp;
-  inuse += classs.inuse,
-      sendto_one(cptr, ":%s %d %s :Confs: inuse: %d(%d)",
-      me.name, RPL_STATSDEBUG, name, GlobalConfCount,
-      tmp = GlobalConfCount * sizeof(struct ConfItem));
+  inuse += classs.inuse;
+  send_reply(cptr, SND_EXPLICIT | RPL_STATSDEBUG, ":Confs: inuse: %d(%d)",
+            GlobalConfCount, tmp = GlobalConfCount * sizeof(struct ConfItem));
   mem += tmp;
-  inuse += GlobalConfCount,
-      sendto_one(cptr, ":%s %d %s :Totals: inuse %d %d",
-      me.name, RPL_STATSDEBUG, name, inuse, mem);
+  inuse += GlobalConfCount;
+  send_reply(cptr, SND_EXPLICIT | RPL_STATSDEBUG, ":Totals: inuse %d %d",
+            inuse, mem);
 }
 
 #endif