Committer : entrope
CVSROOT : /cvsroot/undernet-ircu
Module : ircu2.10
Commit time: 2005-08-21 13:46:18 UTC
Modified files:
ChangeLog include/s_conf.h ircd/ircd_parser.y ircd/m_kill.c
ircd/s_conf.c
Log message:
Fix bugs in rehashing pseudo commands and in kill handling.
---------------------- diff included ----------------------
Index: ircu2.10/ChangeLog
diff -u ircu2.10/ChangeLog:1.676 ircu2.10/ChangeLog:1.677
--- ircu2.10/ChangeLog:1.676 Fri Aug 19 04:46:51 2005
+++ ircu2.10/ChangeLog Sun Aug 21 06:46:05 2005
@@ -1,3 +1,15 @@
+2005-08-21 Michael Poole <[EMAIL PROTECTED]>
+
+ * include/s_conf.h (free_mapping): Declare new function.
+
+ * ircd/ircd_parser.y (pseudoblock): Use it.
+
+ * ircd/s_conf.c (free_mapping): Define it.
+ (close_mappings): New function.
+ (rehash): Call close_mappings() before reading file.
+
+ * ircd/m_kill.c (do_kill): Revert 2005-08-18 change.
+
2005-08-19 Michael Poole <[EMAIL PROTECTED]>
* ircd/parse.c (tok_tree): Re-add token tree structure.
Index: ircu2.10/include/s_conf.h
diff -u ircu2.10/include/s_conf.h:1.33 ircu2.10/include/s_conf.h:1.34
--- ircu2.10/include/s_conf.h:1.33 Sun Apr 24 20:35:54 2005
+++ ircu2.10/include/s_conf.h Sun Aug 21 06:46:07 2005
@@ -1,6 +1,6 @@
/** @file s_conf.h
* @brief ircd configuration file API.
- * @version $Id: s_conf.h,v 1.33 2005/04/25 03:35:54 entrope Exp $
+ * @version $Id: s_conf.h,v 1.34 2005/08/21 13:46:07 entrope Exp $
*/
#ifndef INCLUDED_s_conf_h
#define INCLUDED_s_conf_h
@@ -186,6 +186,7 @@
extern void lookup_confhost(struct ConfItem *aconf);
extern void conf_parse_userhost(struct ConfItem *aconf, char *host);
extern struct ConfItem *conf_debug_iline(const char *client);
+extern void free_mapping(struct s_map *smap);
extern void yyerror(const char *msg);
Index: ircu2.10/ircd/ircd_parser.y
diff -u ircu2.10/ircd/ircd_parser.y:1.55 ircu2.10/ircd/ircd_parser.y:1.56
--- ircu2.10/ircd/ircd_parser.y:1.55 Thu Jul 14 18:53:13 2005
+++ ircu2.10/ircd/ircd_parser.y Sun Aug 21 06:46:07 2005
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
* USA.
- * $Id: ircd_parser.y,v 1.55 2005/07/15 01:53:13 entrope Exp $
+ * $Id: ircd_parser.y,v 1.56 2005/08/21 13:46:07 entrope Exp $
*/
%{
@@ -959,16 +959,7 @@
}
else
{
- struct nick_host *nh, *next;
- for (nh = smap->services; nh; nh = next)
- {
- next = nh->next;
- MyFree(nh);
- }
- MyFree(smap->name);
- MyFree(smap->command);
- MyFree(smap->prepend);
- MyFree(smap);
+ free_mapping(smap);
}
smap = NULL;
};
Index: ircu2.10/ircd/m_kill.c
diff -u ircu2.10/ircd/m_kill.c:1.30 ircu2.10/ircd/m_kill.c:1.31
--- ircu2.10/ircd/m_kill.c:1.30 Fri Aug 19 04:46:51 2005
+++ ircu2.10/ircd/m_kill.c Sun Aug 21 06:46:07 2005
@@ -20,7 +20,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: m_kill.c,v 1.30 2005/08/19 11:46:51 entrope Exp $
+ * $Id: m_kill.c,v 1.31 2005/08/21 13:46:07 entrope Exp $
*/
/*
@@ -155,7 +155,7 @@
victim, "%C :%s %s", victim, feature_bool(FEAT_HIS_KILLWHO)
? feature_str(FEAT_HIS_SERVERNAME) : cli_name(sptr), msg);
return exit_client_msg(cptr, victim, feature_bool(FEAT_HIS_KILLWHO)
- ? &his : sptr, "Killed (%s %s)",
+ ? &me : sptr, "Killed (%s %s)",
feature_bool(FEAT_HIS_KILLWHO) ?
feature_str(FEAT_HIS_SERVERNAME) : cli_name(sptr),
msg);
Index: ircu2.10/ircd/s_conf.c
diff -u ircu2.10/ircd/s_conf.c:1.79 ircu2.10/ircd/s_conf.c:1.80
--- ircu2.10/ircd/s_conf.c:1.79 Mon Jun 27 06:25:52 2005
+++ ircu2.10/ircd/s_conf.c Sun Aug 21 06:46:08 2005
@@ -19,7 +19,7 @@
*/
/** @file
* @brief ircd configuration file driver
- * @version $Id: s_conf.c,v 1.79 2005/06/27 13:25:52 entrope Exp $
+ * @version $Id: s_conf.c,v 1.80 2005/08/21 13:46:08 entrope Exp $
*/
#include "config.h"
@@ -876,6 +876,35 @@
attach_conf_uworld(lp->value.cptr);
}
+/** Free all memory associated with service mapping \a smap.
+ * @param smap[in] The mapping to free.
+ */
+void free_mapping(struct s_map *smap)
+{
+ struct nick_host *nh, *next;
+ for (nh = smap->services; nh; nh = next)
+ {
+ next = nh->next;
+ MyFree(nh);
+ }
+ MyFree(smap->name);
+ MyFree(smap->command);
+ MyFree(smap->prepend);
+ MyFree(smap);
+}
+
+/** Unregister and free all current service mappings. */
+static void close_mappings(void)
+{
+ struct s_map *map, *next;
+
+ for (map = GlobalServiceMapList; map; map = next) {
+ next = map->next;
+ unregister_mapping(map);
+ free_mapping(map);
+ }
+}
+
/** Reload the configuration file.
* @param cptr Client that requested rehash (if a signal, &me).
* @param sig Type of rehash (0 = oper-requested, 1 = signal, 2 =
@@ -934,6 +963,7 @@
class_mark_delete();
mark_listeners_closing();
iauth_mark_closing();
+ close_mappings();
read_configuration_file();
----------------------- End of diff -----------------------
_______________________________________________
Patches mailing list
[EMAIL PROTECTED]
http://undernet.sbg.org/mailman/listinfo/patches