+2005-08-21 Michael Poole <mdpoole@troilus.org>
+
+ * 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 <mdpoole@troilus.org>
* ircd/parse.c (tok_tree): Re-add token tree structure.
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);
}
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;
};
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);
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 =
class_mark_delete();
mark_listeners_closing();
iauth_mark_closing();
+ close_mappings();
read_configuration_file();