]> jfr.im git - solanum.git/blobdiff - modules/m_stats.c
msg: remove last vestiges of the fakelag system. charybdis has never supported fakelag.
[solanum.git] / modules / m_stats.c
index b1d559674d600c9949a0fd85fc525945f1a78c44..1bdeb244b4c4795eb716a68c5d90c0f09de9e1c2 100644 (file)
 #include "reject.h"
 #include "whowas.h"
 #include "irc_radixtree.h"
+#include "sslproc.h"
 
-static int m_stats (struct Client *, struct Client *, int, const char **);
+static int m_stats (struct MsgBuf *, struct Client *, struct Client *, int, const char **);
 
 struct Message stats_msgtab = {
-       "STATS", 0, 0, 0, MFLG_SLOW,
+       "STATS", 0, 0, 0, 0,
        {mg_unreg, {m_stats, 2}, {m_stats, 3}, mg_ignore, mg_ignore, {m_stats, 2}}
 };
 
@@ -109,6 +110,7 @@ static void stats_operedup(struct Client *);
 static void stats_ports(struct Client *);
 static void stats_tresv(struct Client *);
 static void stats_resv(struct Client *);
+static void stats_ssld(struct Client *);
 static void stats_usage(struct Client *);
 static void stats_tstats(struct Client *);
 static void stats_uptime(struct Client *);
@@ -162,6 +164,8 @@ static struct StatsStruct stats_cmd_table[] = {
        {'Q', stats_resv,               1, 0, },
        {'r', stats_usage,              1, 0, },
        {'R', stats_usage,              1, 0, },
+       {'s', stats_ssld,               1, 1, },
+       {'S', stats_ssld,               1, 1, },
        {'t', stats_tstats,             1, 0, },
        {'T', stats_tstats,             1, 0, },
        {'u', stats_uptime,             0, 0, },
@@ -187,7 +191,7 @@ static struct StatsStruct stats_cmd_table[] = {
  * if found execute it.
  */
 static int
-m_stats(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
+m_stats(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
 {
        static time_t last_used = 0;
        int i;
@@ -884,6 +888,26 @@ stats_resv(struct Client *source_p)
        }
 }
 
+static void
+stats_ssld_foreach(void *data, pid_t pid, int cli_count, enum ssld_status status)
+{
+       struct Client *source_p = data;
+
+       sendto_one_numeric(source_p, RPL_STATSDEBUG,
+                       "S :%u %c %u",
+                       pid,
+                       status == SSLD_DEAD ? 'D' : (status == SSLD_SHUTDOWN ? 'S' : 'A'),
+                       cli_count);
+}
+
+static void
+stats_ssld(struct Client *source_p)
+{
+#if 0
+       ssld_foreach_info(stats_ssld_foreach, source_p);
+#endif
+}
+
 static void
 stats_usage (struct Client *source_p)
 {
@@ -1267,7 +1291,7 @@ stats_memory (struct Client *source_p)
 
        size_t total_memory = 0;
 
-       count_whowas_memory(&ww, &wwm);
+       whowas_memory_usage(&ww, &wwm);
 
        RB_DLINK_FOREACH(ptr, global_client_list.head)
        {