]> jfr.im git - solanum.git/blobdiff - modules/m_rehash.c
msg: remove last vestiges of the fakelag system. charybdis has never supported fakelag.
[solanum.git] / modules / m_rehash.c
index 8557f8c7104bcf5b95892097f2d9f1f998e20c27..3caef467e32235aa0fb3c39681cd56196856c282 100644 (file)
@@ -32,7 +32,6 @@
 #include "ircd.h"
 #include "s_serv.h"
 #include "numeric.h"
-#include "res.h"
 #include "s_conf.h"
 #include "s_newconf.h"
 #include "logger.h"
 #include "reject.h"
 #include "hash.h"
 #include "cache.h"
+#include "irc_radixtree.h"
+#include "sslproc.h"
 
-static int mo_rehash(struct Client *, struct Client *, int, const char **);
-static int me_rehash(struct Client *, struct Client *, int, const char **);
+static int mo_rehash(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
+static int me_rehash(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
 
 struct Message rehash_msgtab = {
-       "REHASH", 0, 0, 0, MFLG_SLOW,
+       "REHASH", 0, 0, 0, 0,
        {mg_unreg, mg_not_oper, mg_ignore, mg_ignore, {me_rehash, 0}, {mo_rehash, 0}}
 };
 
@@ -76,13 +77,22 @@ rehash_bans_loc(struct Client *source_p)
 static void
 rehash_dns(struct Client *source_p)
 {
-       sendto_realops_snomask(SNO_GENERAL, L_ALL, "%s is rehashing DNS", 
+       sendto_realops_snomask(SNO_GENERAL, L_ALL, "%s is rehashing DNS",
                             get_oper_name(source_p));
        if (!MyConnect(source_p))
                remote_rehash_oper_p = source_p;
 
        /* reread /etc/resolv.conf and reopen res socket */
-       restart_resolver();
+       restart_authd();
+}
+
+static void
+rehash_ssld(struct Client *source_p)
+{
+       sendto_realops_snomask(SNO_GENERAL, L_ALL, "%s is restarting ssld",
+                               get_oper_name(source_p));
+
+       restart_ssld();
 }
 
 static void
@@ -186,6 +196,7 @@ static void
 rehash_tresvs(struct Client *source_p)
 {
        struct ConfItem *aconf;
+       struct irc_radixtree_iteration_state iter;
        rb_dlink_node *ptr;
        rb_dlink_node *next_ptr;
        int i;
@@ -195,17 +206,14 @@ rehash_tresvs(struct Client *source_p)
        if (!MyConnect(source_p))
                remote_rehash_oper_p = source_p;
 
-       HASH_WALK_SAFE(i, R_MAX, ptr, next_ptr, resvTable)
+       IRC_RADIXTREE_FOREACH(aconf, &iter, resv_tree)
        {
-               aconf = ptr->data;
-
                if(!aconf->hold || aconf->lifetime)
                        continue;
 
+               irc_radixtree_delete(resv_tree, aconf->host);
                free_conf(aconf);
-               rb_dlinkDestroy(ptr, &resvTable[i]);
        }
-       HASH_WALK_END
 
        RB_DLINK_FOREACH_SAFE(ptr, next_ptr, resv_conf_list.head)
        {
@@ -245,7 +253,7 @@ static void
 rehash_help(struct Client *source_p)
 {
        sendto_realops_snomask(SNO_GENERAL, L_ALL,
-                            "%s is forcing re-reading of HELP files", 
+                            "%s is forcing re-reading of HELP files",
                             get_oper_name(source_p));
        if (!MyConnect(source_p))
                remote_rehash_oper_p = source_p;
@@ -268,7 +276,7 @@ rehash_nickdelay(struct Client *source_p)
        RB_DLINK_FOREACH_SAFE(ptr, safe_ptr, nd_list.head)
        {
                nd = ptr->data;
-       
+
                free_nd_entry(nd);
        }
 }
@@ -278,6 +286,7 @@ static struct hash_commands rehash_commands[] =
 {
        {"BANS",        rehash_bans_loc         },
        {"DNS",         rehash_dns              },
+       {"SSLD",        rehash_ssld             },
        {"MOTD",        rehash_motd             },
        {"OMOTD",       rehash_omotd            },
        {"TKLINES",     rehash_tklines          },
@@ -347,7 +356,7 @@ do_rehash(struct Client *source_p, const char *type)
  * parv[2] = destination
  */
 static int
-mo_rehash(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
+mo_rehash(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
 {
        const char *type = NULL, *target_server = NULL;
 
@@ -389,7 +398,7 @@ mo_rehash(struct Client *client_p, struct Client *source_p, int parc, const char
 }
 
 static int
-me_rehash(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
+me_rehash(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
 {
 
        if (!IsPerson(source_p))