Put 0 before addresses like ::1 in "STATS c" and "STATS i".
authorMichael Poole <mdpoole@troilus.org>
Sat, 19 Feb 2005 17:15:38 +0000 (17:15 +0000)
committerMichael Poole <mdpoole@troilus.org>
Sat, 19 Feb 2005 17:15:38 +0000 (17:15 +0000)
Change "STATS o" to look more like in .11.

git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/trunk@1316 c9e4aea6-c8fd-4c43-8297-357d70d61c8c

ChangeLog
ircd/s_err.c
ircd/s_stats.c

index 16c7c2188a866c574c7614a100c770e38b818a02..38bffe8b4b917749b0613dbdc5463ba9bfd5284f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2005-02-19  Michael Poole <mdpoole@troilus.org>
+
+       * ircd/s_err.c (RPL_STATSCLINE): Add format field to prefix IPv6
+       addresses starting with ':'.
+       (RPL_STATSILINE): Likewise.
+       (RPL_STATSOLINE): Add format field for username.
+
+       * ircd/s_stats.c (stats_configured_links): Pass the appropriate
+       argument for the RPL_STATSxLINE changes.
+
 2005-02-18  Michael Poole <mdpoole@troilus.org>
 
        * ircd/IPcheck.c (ip_registry_find): Use canonical form of IP
index c8d015a7a883de76fd13da065d9ef3d032302b88..7c0c91532cc3563845e2664415053b043180b08e 100644 (file)
@@ -458,11 +458,11 @@ static Numeric replyTable[] = {
 /* 212 */
   { RPL_STATSCOMMANDS, "%s %u %u", "212" },
 /* 213 */
-  { RPL_STATSCLINE, "C %s %s %d %d %s %s", "213" },
+  { RPL_STATSCLINE, "C %s %s%s %d %d %s %s", "213" },
 /* 214 */
   { 0 },
 /* 215 */
-  { RPL_STATSILINE, "I %s %d %s %d %s", "215" },
+  { RPL_STATSILINE, "I %s %d %s%s %d %s", "215" },
 /* 216 */
   { RPL_STATSKLINE, "%c %s \"%s\" %s 0 0", "216" },
 /* 217 */
@@ -518,7 +518,7 @@ static Numeric replyTable[] = {
 /* 242 */
   { RPL_STATSUPTIME, ":Server Up %d days, %d:%02d:%02d", "242" },
 /* 243 */
-  { RPL_STATSOLINE, "O %s * %s %d %d", "243" },
+  { RPL_STATSOLINE, "O %s@%s * %s %s", "243" },
 /* 244 */
   { 0 },
 /* 245 */
index 7c54ad208e11ef1a6e39cc67d82513213e3fc234..9c843a4c7e6acf7d61a7b4edb49fbf53f0976981 100644 (file)
@@ -87,7 +87,7 @@ stats_configured_links(struct Client *sptr, const struct StatDesc* sd,
   struct ConfItem *tmp;
   unsigned short int port;
   int maximum;
-  char *host, *pass, *name, *hub_limit;
+  char *host, *pass, *name, *username, *hub_limit;
 
   for (tmp = GlobalConfList; tmp; tmp = tmp->next)
   {
@@ -96,17 +96,18 @@ stats_configured_links(struct Client *sptr, const struct StatDesc* sd,
       host = BadPtr(tmp->host) ? null : tmp->host;
       pass = BadPtr(tmp->passwd) ? null : tmp->passwd;
       name = BadPtr(tmp->name) ? null : tmp->name;
+      username = BadPtr(tmp->username) ? null : tmp->username;
       hub_limit = BadPtr(tmp->hub_limit) ? null : tmp->hub_limit;
       maximum = tmp->maximum;
       port = tmp->address.port;
       if (tmp->status & CONF_UWORLD)
        send_reply(sptr, RPL_STATSULINE, host);
       else if (tmp->status & CONF_SERVER)
-       send_reply(sptr, RPL_STATSCLINE, name, host, port, maximum, hub_limit, get_conf_class(tmp));
+       send_reply(sptr, RPL_STATSCLINE, name, (host[0] == ':' ? "0" : ""), host, port, maximum, hub_limit, get_conf_class(tmp));
       else if (tmp->status & CONF_CLIENT)
-        send_reply(sptr, RPL_STATSILINE, host, maximum, name, port, get_conf_class(tmp));
+        send_reply(sptr, RPL_STATSILINE, host, maximum, (name[0] == ':' ? "0" : ""), name, port, get_conf_class(tmp));
       else if (tmp->status & CONF_OPERATOR)
-       send_reply(sptr, RPL_STATSOLINE, host, name, port, get_conf_class(tmp));
+       send_reply(sptr, RPL_STATSOLINE, username, host, name, get_conf_class(tmp));
     }
   }
 }