Show LIST_CHAN privilege, count User structs better, text: line->block.
[ircu2.10.12-pk.git] / ircd / s_debug.c
index 56e76c85b540b6da89e54e756d8f05b46cda0164..efa57eef352c5ad6f44f5982db6f4ca818581756 100644 (file)
@@ -44,6 +44,7 @@
 #include "res.h"
 #include "s_bsd.h"
 #include "s_conf.h"
+#include "s_user.h"
 #include "s_stats.h"
 #include "send.h"
 #include "struct.h"
@@ -217,7 +218,6 @@ void count_memory(struct Client *cptr, const struct StatDesc *sd,
       cn = 0,                   /* connections */
       ch = 0,                   /* channels */
       lcc = 0,                  /* local client conf links */
-      us = 0,                   /* user structs */
       chi = 0,                  /* channel invites */
       chb = 0,                  /* channel bans */
       wwu = 0,                  /* whowas users */
@@ -235,6 +235,8 @@ void count_memory(struct Client *cptr, const struct StatDesc *sd,
       chbm = 0,                 /* memory used by channel bans */
       cm = 0,                   /* memory used by clients */
       cnm = 0,                  /* memory used by connections */
+      us = 0,                   /* user structs */
+      usm = 0,                  /* memory used by user structs */
       awm = 0,                  /* memory used by aways */
       wwam = 0,                 /* whowas away memory used */
       wwm = 0,                  /* whowas array memory used */
@@ -263,7 +265,6 @@ void count_memory(struct Client *cptr, const struct StatDesc *sd,
     }
     if (cli_user(acptr))
     {
-      us++;
       for (link = cli_user(acptr)->invited; link; link = link->next)
         usi++;
       for (member = cli_user(acptr)->channel; member; member = member->next_channel)
@@ -280,6 +281,7 @@ void count_memory(struct Client *cptr, const struct StatDesc *sd,
   }
   cm = c * sizeof(struct Client);
   cnm = cn * sizeof(struct Connection);
+  user_count_memory(&us, &usm);
 
   for (chptr = GlobalChannelList; chptr; chptr = chptr->next)
   {
@@ -309,8 +311,8 @@ void count_memory(struct Client *cptr, const struct StatDesc *sd,
   send_reply(cptr, SND_EXPLICIT | RPL_STATSDEBUG,
             ":Clients %d(%zu) Connections %d(%zu)", c, cm, cn, cnm);
   send_reply(cptr, SND_EXPLICIT | RPL_STATSDEBUG,
-            ":Users %d(%zu) Accounts %d(%zu) Invites %d(%zu)",
-             us, us * sizeof(struct User), acc, acc * (ACCOUNTLEN + 1),
+            ":Users %zu(%zu) Accounts %d(%zu) Invites %d(%zu)",
+             us, usm, acc, acc * (ACCOUNTLEN + 1),
             usi, usi * sizeof(struct SLink));
   send_reply(cptr, SND_EXPLICIT | RPL_STATSDEBUG,
             ":User channels %d(%zu) Aways %d(%zu)", memberships,