Committer  : entrope
CVSROOT    : /cvsroot/undernet-ircu
Module     : ircu2.10
Commit time: 2005-06-14 04:47:10 UTC

Modified files:
     ircd/s_user.c ircd/s_debug.c ircd/s_conf.c ChangeLog

Log message:

Fix some memory counting buglets.

---------------------- diff included ----------------------
Index: ircu2.10/ChangeLog
diff -u ircu2.10/ChangeLog:1.643 ircu2.10/ChangeLog:1.644
--- ircu2.10/ChangeLog:1.643    Sun Jun 12 19:30:36 2005
+++ ircu2.10/ChangeLog  Mon Jun 13 21:47:00 2005
@@ -1,3 +1,16 @@
+2005-05-13  Michael Poole <[EMAIL PROTECTED]>
+
+       * ircd/s_user.c (make_user): Unconditionally increment userCount.
+       (free_user): Unconditionally decrement it here.
+
+       * ircd/s_conf.c (make_conf): Unconditionally increment
+       GlobalConfCount.
+       (free_conf): Unconditionally decrement it here.
+
+       * ircd/s_debug.c (count_memory): Fix termination condition for
+       ban-walking loop.  Add missing "e" to "members".
+
+
 2005-05-10  Michael Poole <[EMAIL PROTECTED]>
 
        * ircd/match.c (check_if_ipmask): Strings that contain '?' cannot
Index: ircu2.10/ircd/s_conf.c
diff -u ircu2.10/ircd/s_conf.c:1.77 ircu2.10/ircd/s_conf.c:1.78
--- ircu2.10/ircd/s_conf.c:1.77 Mon May 30 09:51:04 2005
+++ ircu2.10/ircd/s_conf.c      Mon Jun 13 21:47:00 2005
@@ -19,7 +19,7 @@
  */
 /** @file
  * @brief ircd configuration file driver
- * @version $Id: s_conf.c,v 1.77 2005/05/30 16:51:04 entrope Exp $
+ * @version $Id: s_conf.c,v 1.78 2005/06/14 04:47:00 entrope Exp $
  */
 #include "config.h"
 
@@ -129,9 +129,7 @@
 
   aconf = (struct ConfItem*) MyMalloc(sizeof(struct ConfItem));
   assert(0 != aconf);
-#ifdef        DEBUGMODE
   ++GlobalConfCount;
-#endif
   memset(aconf, 0, sizeof(struct ConfItem));
   aconf->status  = type;
   aconf->next    = GlobalConfList;
@@ -159,9 +157,7 @@
   MyFree(aconf->name);
   MyFree(aconf->hub_limit);
   MyFree(aconf);
-#ifdef        DEBUGMODE
   --GlobalConfCount;
-#endif
 }
 
 /** Disassociate configuration from the client.
Index: ircu2.10/ircd/s_debug.c
diff -u ircu2.10/ircd/s_debug.c:1.39 ircu2.10/ircd/s_debug.c:1.40
--- ircu2.10/ircd/s_debug.c:1.39        Mon May 30 14:11:38 2005
+++ ircu2.10/ircd/s_debug.c     Mon Jun 13 21:47:00 2005
@@ -19,7 +19,7 @@
  */
 /** @file
  * @brief Debug support for the ircd.
- * @version $Id: s_debug.c,v 1.39 2005/05/30 21:11:38 entrope Exp $
+ * @version $Id: s_debug.c,v 1.40 2005/06/14 04:47:00 entrope Exp $
  */
 #include "config.h"
 
@@ -292,7 +292,7 @@
     chm += (strlen(chptr->chname) + sizeof(struct Channel));
     for (link = chptr->invites; link; link = link->next)
       chi++;
-    for (ban = chptr->banlist; link; ban = ban->next)
+    for (ban = chptr->banlist; ban; ban = ban->next)
     {
       chb++;
       chbm += strlen(ban->who) + strlen(ban->banstr) + 2 + sizeof(*ban);
@@ -335,7 +335,7 @@
   send_reply(cptr, SND_EXPLICIT | RPL_STATSDEBUG,
             ":Channels %d(%zu) Bans %d(%zu)", ch, chm, chb, chbm);
   send_reply(cptr, SND_EXPLICIT | RPL_STATSDEBUG,
-            ":Channel membrs %d(%zu) invite %d(%zu)", memberships,
+            ":Channel members %d(%zu) invite %d(%zu)", memberships,
             memberships * sizeof(struct Membership), chi,
             chi * sizeof(struct SLink));
 
Index: ircu2.10/ircd/s_user.c
diff -u ircu2.10/ircd/s_user.c:1.96 ircu2.10/ircd/s_user.c:1.97
--- ircu2.10/ircd/s_user.c:1.96 Mon May 30 06:16:55 2005
+++ ircu2.10/ircd/s_user.c      Mon Jun 13 21:47:00 2005
@@ -22,7 +22,7 @@
  */
 /** @file
  * @brief Miscellaneous user-related helper functions.
- * @version $Id: s_user.c,v 1.96 2005/05/30 13:16:55 entrope Exp $
+ * @version $Id: s_user.c,v 1.97 2005/06/14 04:47:00 entrope Exp $
  */
 #include "config.h"
 
@@ -91,9 +91,7 @@
 
     /* All variables are 0 by default */
     memset(cli_user(cptr), 0, sizeof(struct User));
-#ifdef  DEBUGMODE
     ++userCount;
-#endif
     cli_user(cptr)->refcnt = 1;
   }
   return cli_user(cptr);
@@ -120,9 +118,7 @@
     assert(0 == user->channel);
 
     MyFree(user);
-#ifdef  DEBUGMODE
     --userCount;
-#endif
   }
 }
 
----------------------- End of diff -----------------------
_______________________________________________
Patches mailing list
[email protected]
http://undernet.sbg.org/mailman/listinfo/patches

Reply via email to