]> jfr.im git - irc/rqf/shadowircd.git/commitdiff
Update /stats z for removal of struct User from whowas.
authorJilles Tjoelker <redacted>
Tue, 22 Jan 2008 21:07:11 +0000 (22:07 +0100)
committerJilles Tjoelker <redacted>
Tue, 22 Jan 2008 21:07:11 +0000 (22:07 +0100)
This was done in hybrid 5 or earlier...

src/s_stats.c
src/whowas.c

index f1918a2688506b369db43e7c7745a9e8337a7dfb..8efde154f1055f909242f617cb093cfea862e9ae 100644 (file)
@@ -180,7 +180,6 @@ count_memory(struct Client *source_p)
        int channel_invex = 0;
        int channel_quiets = 0;
 
-       size_t wwu = 0;         /* whowas users */
        int class_count = 0;    /* classes */
        int conf_count = 0;     /* conf lines */
        int users_invited_count = 0;    /* users invited */
@@ -195,6 +194,7 @@ count_memory(struct Client *source_p)
        size_t channel_quiet_memory = 0;
 
        size_t away_memory = 0; /* memory used by aways */
+       size_t ww = 0;          /* whowas array count */
        size_t wwm = 0;         /* whowas array memory used */
        size_t conf_memory = 0; /* memory used by conf lines */
        size_t mem_servers_cached;      /* memory used by scache */
@@ -213,7 +213,7 @@ count_memory(struct Client *source_p)
 
        size_t total_memory = 0;
 
-       count_whowas_memory(&wwu, &wwm);
+       count_whowas_memory(&ww, &wwm);
 
        DLINK_FOREACH(ptr, global_client_list.head)
        {
@@ -334,14 +334,10 @@ count_memory(struct Client *source_p)
                channel_users * sizeof(dlink_node) + channel_invites * sizeof(dlink_node);
 
        sendto_one_numeric(source_p, RPL_STATSDEBUG,
-                          "z :Whowas users %ld(%ld)",
-                          (long)wwu, (long) (wwu * sizeof(struct User)));
+                          "z :Whowas array %ld(%ld)",
+                          (long)ww, (long)wwm);
 
-       sendto_one_numeric(source_p, RPL_STATSDEBUG,
-                          "z :Whowas array %u(%d)",
-                          NICKNAMEHISTORYLENGTH, (int) wwm);
-
-       totww = wwu * sizeof(struct User) + wwm;
+       totww = wwm;
 
        sendto_one_numeric(source_p, RPL_STATSDEBUG,
                           "z :Hash: client %u(%ld) chan %u(%ld)",
index 880826fc9011511d425218bb6f547958c5d82910..cd615c12b650eeb931ba651937c3503f400bcf88 100644 (file)
@@ -135,23 +135,8 @@ struct Client *get_history(const char *nick, time_t timelimit)
 
 void count_whowas_memory(size_t * wwu, size_t * wwum)
 {
-       struct Whowas *tmp;
-       int i;
-       size_t u = 0;
-       size_t um = 0;
-
-       /* count the number of used whowas structs in 'u' */
-       /* count up the memory used of whowas structs in um */
-
-       for (i = 0, tmp = &WHOWAS[0]; i < NICKNAMEHISTORYLENGTH; i++, tmp++)
-               if(tmp->hashv != -1)
-               {
-                       u++;
-                       um += sizeof(struct Whowas);
-               }
-       *wwu = u;
-       *wwum = um;
-       return;
+       *wwu = NICKNAMEHISTORYLENGTH;
+       *wwum = NICKNAMEHISTORYLENGTH * sizeof(struct Whowas);
 }
 
 void