Committer  : entrope
CVSROOT    : /cvsroot/undernet-ircu
Module     : ircu2.10
Commit time: 2006-07-25 00:17:41 UTC

Modified files:
     ircd/motd.c ircd/ircd_features.c include/motd.h ChangeLog

Log message:

Split motd_init() into two functions to fix a rehash bug.

---------------------- diff included ----------------------
Index: ircu2.10/ChangeLog
diff -u ircu2.10/ChangeLog:1.808 ircu2.10/ChangeLog:1.809
--- ircu2.10/ChangeLog:1.808    Sun Jul 23 19:08:33 2006
+++ ircu2.10/ChangeLog  Mon Jul 24 17:17:30 2006
@@ -1,3 +1,13 @@
+2006-07-24  Michael Poole <[EMAIL PROTECTED]>
+
+       * include/motd.h (motd_init): Split into two functions.
+
+       * ircd/ircd_features.c (FEAT_NOINIT): Delete.
+       (features): Remove FEAT_NOINIT from remote motd filename.
+       (feature_init): Remove FEAT_NOINIT check.
+
+       * ircd/motd.c (motd_init): Split into two functions.
+
 2006-07-23  Michael Poole <[EMAIL PROTECTED]>
 
        * include/channel.h (struct Invite): New structure.
Index: ircu2.10/include/motd.h
diff -u ircu2.10/include/motd.h:1.8 ircu2.10/include/motd.h:1.9
--- ircu2.10/include/motd.h:1.8 Sat Oct 16 18:58:16 2004
+++ ircu2.10/include/motd.h     Mon Jul 24 17:17:30 2006
@@ -22,7 +22,7 @@
  */
 /** @file
  * @brief Message-of-the-day manipulation interface and declarations.
- * @version $Id: motd.h,v 1.8 2004/10/17 01:58:16 entrope Exp $
+ * @version $Id: motd.h,v 1.9 2006/07/25 00:17:30 entrope Exp $
  */
 
 #ifndef INCLUDED_time_h
@@ -91,10 +91,11 @@
 /* motd_recache causes all the MOTD caches to be cleared */
 void motd_recache(void);
 
-/* motd_init initializes the MOTD routines, including reading the
+/* motd_init_* initialize the MOTDs, including reading the
  * ircd.motd and remote.motd files into cache
  */
-void motd_init(void);
+void motd_init_local(void);
+void motd_init_remote(void);
 
 /* This routine adds a MOTD */
 void motd_add(const char *hostmask, const char *path);
Index: ircu2.10/ircd/ircd_features.c
diff -u ircu2.10/ircd/ircd_features.c:1.60 ircu2.10/ircd/ircd_features.c:1.61
--- ircu2.10/ircd/ircd_features.c:1.60  Sun Jul 23 11:17:50 2006
+++ ircu2.10/ircd/ircd_features.c       Mon Jul 24 17:17:30 2006
@@ -18,7 +18,7 @@
  */
 /** @file
  * @brief Implementation of configurable feature support.
- * @version $Id: ircd_features.c,v 1.60 2006/07/23 18:17:50 entrope Exp $
+ * @version $Id: ircd_features.c,v 1.61 2006/07/25 00:17:30 entrope Exp $
  */
 #include "config.h"
 
@@ -300,7 +300,6 @@
 #define FEAT_OPER   0x0100     /**< set to display only to opers */
 #define FEAT_MYOPER 0x0200     /**< set to display only to local opers */
 #define FEAT_NODISP 0x0400     /**< feature must never be displayed */
-#define FEAT_NOINIT 0x0800      /**< notifier should not be called at init */
 
 #define FEAT_READ   0x1000     /**< feature is read-only (for now, perhaps?) */
 
@@ -399,8 +398,8 @@
   F_I(CHANNELLEN, 0, 200, set_isupport_channellen),
 
   /* Some misc. default paths */
-  F_S(MPATH, FEAT_CASE | FEAT_MYOPER, "ircd.motd", motd_init),
-  F_S(RPATH, FEAT_CASE | FEAT_MYOPER | FEAT_NOINIT, "remote.motd", motd_init),
+  F_S(MPATH, FEAT_CASE | FEAT_MYOPER, "ircd.motd", motd_init_local),
+  F_S(RPATH, FEAT_CASE | FEAT_MYOPER, "remote.motd", motd_init_remote),
   F_S(PPATH, FEAT_CASE | FEAT_MYOPER | FEAT_READ, "ircd.pid", 0),
 
   /* Networking features */
@@ -902,7 +901,7 @@
       break;
     }
 
-    if (feat->notify && !(feat->flags & FEAT_NOINIT))
+    if (feat->notify)
       (*feat->notify)();
   }
 
Index: ircu2.10/ircd/motd.c
diff -u ircu2.10/ircd/motd.c:1.25 ircu2.10/ircd/motd.c:1.26
--- ircu2.10/ircd/motd.c:1.25   Fri Jul 14 17:09:10 2006
+++ ircu2.10/ircd/motd.c        Mon Jul 24 17:17:30 2006
@@ -23,7 +23,7 @@
  */
 /** @file
  * @brief Message-of-the-day manipulation implementation.
- * @version $Id: motd.c,v 1.25 2006/07/15 00:09:10 entrope Exp $
+ * @version $Id: motd.c,v 1.26 2006/07/25 00:17:30 entrope Exp $
  */
 #include "config.h"
 
@@ -362,11 +362,11 @@
   motd_cache(MotdList.remote);
 }
 
-/** Re-cache the local and remote MOTDs.
- * If they already exist, they are deallocated first.
+/** Re-cache the local MOTD.
+ * If it already exists it is deallocated first.
  */
 void
-motd_init(void)
+motd_init_local(void)
 {
   if (MotdList.local) /* destroy old local... */
     motd_destroy(MotdList.local);
@@ -376,7 +376,14 @@
     MotdList.local = motd_create(0, feature_str(FEAT_MPATH), MOTD_MAXLINES);
     motd_cache(MotdList.local); /* init local and cache it */
   }
+}
 
+/** Re-cache the remote MOTD.
+ * If it already exists it is deallocated first.
+ */
+void
+motd_init_remote(void)
+{
   if (MotdList.remote) /* destroy old remote... */
     motd_destroy(MotdList.remote);
 
----------------------- End of diff -----------------------
_______________________________________________
Patches mailing list
[email protected]
http://undernet.sbg.org/mailman/listinfo/patches

Reply via email to