From: Michael Poole Date: Mon, 30 May 2005 18:46:20 +0000 (+0000) Subject: Numeric reply bug fixes and cleanup. X-Git-Url: http://git.pk910.de/?p=ircu2.10.12-pk.git;a=commitdiff_plain;h=71cc7cba8ab3e34d60d4887eecaaf454aa84a321 Numeric reply bug fixes and cleanup. git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/trunk@1416 c9e4aea6-c8fd-4c43-8297-357d70d61c8c --- diff --git a/ChangeLog b/ChangeLog index 0fa49ee..8ba3eb9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2005-05-30 Michael Poole + + * include/numeric.h (RPL_TRACELOG, RPL_MYPORTIS, + RPL_NOTOPERANYMORE): Undefine unused numeric replies. + + * ircd/s_err.c (replyTable): Fix format fields for certain numeric + arguments. Remove some unused entries. + + * ircd/s_stats.c (stats_configured_links): Move invariant + parameters to message format string. + 2005-05-30 Michael Poole * ircd/client.c (privtab): Add missing LIST_CHAN privilege, move diff --git a/include/numeric.h b/include/numeric.h index 094349c..0ce4bdc 100644 --- a/include/numeric.h +++ b/include/numeric.h @@ -118,12 +118,12 @@ extern const struct Numeric* get_error_numeric(int err); #define RPL_STATSALINE 226 /* Hybrid, Undernet */ #define RPL_STATSQLINE 228 /* Undernet extension */ -#define RPL_SERVICEINFO 231 /* unused */ -#define RPL_ENDOFSERVICES 232 /* unused */ +/* RPL_SERVICEINFO 231 unused */ +/* RPL_ENDOFSERVICES 232 unused */ /* RPL_RULES 232 unreal */ -#define RPL_SERVICE 233 /* unused */ -#define RPL_SERVLIST 234 /* unused */ -#define RPL_SERVLISTEND 235 /* unused */ +/* RPL_SERVICE 233 unused */ +/* RPL_SERVLIST 234 unused */ +/* RPL_SERVLISTEND 235 unused */ #define RPL_STATSVERBOSE 236 /* Undernet verbose server list */ #define RPL_STATSENGINE 237 /* Undernet engine name */ @@ -158,7 +158,7 @@ extern const struct Numeric* get_error_numeric(int err); #define RPL_ADMINLOC2 258 #define RPL_ADMINEMAIL 259 -#define RPL_TRACELOG 261 /* unused */ +/* RPL_TRACELOG 261 unused */ #define RPL_TRACEEND 262 /* efnet/IRCnet */ /* RPL_LOAD_THROTTLED 263 efnet/hybrid */ /* RPL_TRYAGAIN 263 Numerics List: IRCnet */ @@ -203,11 +203,11 @@ extern const struct Numeric* get_error_numeric(int err); /* RPL_END_CHANINFO 299 aircd */ -#define RPL_NONE 300 /* unused */ +/* RPL_NONE 300 unused */ #define RPL_AWAY 301 #define RPL_USERHOST 302 #define RPL_ISON 303 -#define RPL_TEXT 304 /* unused */ +/* RPL_TEXT 304 unused */ #define RPL_UNAWAY 305 #define RPL_NOWAWAY 306 /* NotAway, aircd */ @@ -273,7 +273,7 @@ extern const struct Numeric* get_error_numeric(int err); See also RPL_ENDOFWHO */ #define RPL_DELNAMREPLY 355 /* QuakeNet extension */ -#define RPL_KILLDONE 361 /* not used */ +/* RPL_KILLDONE 361 not used */ #define RPL_CLOSING 362 #define RPL_CLOSEEND 363 #define RPL_LINKS 364 @@ -285,7 +285,7 @@ extern const struct Numeric* get_error_numeric(int err); #define RPL_INFO 371 #define RPL_MOTD 372 -#define RPL_INFOSTART 373 /* not used */ +/* RPL_INFOSTART 373 not used */ #define RPL_ENDOFINFO 374 #define RPL_MOTDSTART 375 #define RPL_ENDOFMOTD 376 @@ -299,13 +299,13 @@ extern const struct Numeric* get_error_numeric(int err); #define RPL_YOUREOPER 381 #define RPL_REHASHING 382 /* RPL_YOURSERVICE 383 Numeric List: various */ -#define RPL_MYPORTIS 384 /* not used */ -#define RPL_NOTOPERANYMORE 385 /* Extension to RFC1459, not used */ +/* RPL_MYPORTIS 384 not used */ +/* RPL_NOTOPERANYMORE 385 Extension to RFC1459, not used */ /* RPL_QLIST 386 unreal */ /* RPL_ENDOFQLIST 387 unreal */ /* RPL_ALIST 388 unreal */ -/* RPL_ENDOFALIST 389 unreal */ - +/* RPL_ENDOFALIST 389 unreal */ + #define RPL_TIME 391 /* RPL_START_USERS 392 Dalnet/EFnet/IRCnet */ /* RPL_USERS 393 Dalnet/EFnet/IRCnet */ @@ -317,7 +317,7 @@ extern const struct Numeric* get_error_numeric(int err); * Errors are in the range from 400-599 currently and are grouped by what * commands they come from. */ -#define ERR_FIRSTERROR 400 /* unused */ +/* ERR_FIRSTERROR 400 unused */ #define ERR_NOSUCHNICK 401 #define ERR_NOSUCHSERVER 402 #define ERR_NOSUCHCHANNEL 403 diff --git a/ircd/s_err.c b/ircd/s_err.c index 26851d3..8ce4b1d 100644 --- a/ircd/s_err.c +++ b/ircd/s_err.c @@ -48,7 +48,7 @@ static Numeric replyTable[] = { /* 007 */ { 0 }, /* 008 */ - { RPL_SNOMASK, "%d :: Server notice mask (%#x)", "008" }, + { RPL_SNOMASK, "%u :: Server notice mask (%#x)", "008" }, /* 009 */ { 0 }, /* 010 */ @@ -62,7 +62,7 @@ static Numeric replyTable[] = { /* 014 */ { 0 }, /* 015 */ - { RPL_MAP, ":%s%s%s %s [%i clients]", "015" }, + { RPL_MAP, ":%s%s%s %s [%u clients]", "015" }, /* 016 */ { RPL_MAPMORE, ":%s%s --> *more*", "016" }, /* 017 */ @@ -450,7 +450,7 @@ static Numeric replyTable[] = { /* 208 */ { RPL_TRACENEWTYPE, " 0 %s", "208" }, /* 209 */ - { RPL_TRACECLASS, "Class %s %d", "209" }, + { RPL_TRACECLASS, "Class %s %u", "209" }, /* 210 */ { 0 }, /* 211 */ @@ -458,7 +458,7 @@ static Numeric replyTable[] = { /* 212 */ { RPL_STATSCOMMANDS, "%s %u %u", "212" }, /* 213 */ - { RPL_STATSCLINE, "C %s %s%s %d %d %s %s", "213" }, + { RPL_STATSCLINE, "C %s * %d %d %s %s", "213" }, /* 214 */ { 0 }, /* 215 */ @@ -468,7 +468,7 @@ static Numeric replyTable[] = { /* 217 */ { RPL_STATSPLINE, "P %d %d %s %s", "217" }, /* 218 */ - { RPL_STATSYLINE, "%c %s %d %d %d %ld %d", "218" }, + { RPL_STATSYLINE, "%c %s %d %d %u %u %u", "218" }, /* 219 */ { RPL_ENDOFSTATS, "%s :End of /STATS report", "219" }, /* 220 */ @@ -494,21 +494,21 @@ static Numeric replyTable[] = { /* 230 */ { 0 }, /* 231 */ - { RPL_SERVICEINFO, 0, "231" }, + { 0 }, /* 232 */ - { RPL_ENDOFSERVICES, 0, "232" }, + { 0 }, /* 233 */ - { RPL_SERVICE, 0, "233" }, + { 0 }, /* 234 */ - { RPL_SERVLIST, 0, "234" }, + { 0 }, /* 235 */ - { RPL_SERVLISTEND, 0, "235" }, + { 0 }, /* 236 */ { RPL_STATSVERBOSE, "V :Sent as explicit", "236" }, /* 237 */ { RPL_STATSENGINE, "%s :Event loop engine", "237" }, /* 238 */ - { RPL_STATSFLINE, "%c %s %s", "238" }, + { RPL_STATSFLINE, "F %s %s", "238" }, /* 239 */ { 0 }, /* 240 */ @@ -532,17 +532,17 @@ static Numeric replyTable[] = { /* 249 */ { RPL_STATSDEBUG, 0, "249" }, /* 250 */ - { RPL_STATSCONN, ":Highest connection count: %d (%d clients)", "250" }, + { RPL_STATSCONN, ":Highest connection count: %u (%u clients)", "250" }, /* 251 */ - { RPL_LUSERCLIENT, ":There are %d users and %d invisible on %d servers", "251" }, + { RPL_LUSERCLIENT, ":There are %u users and %u invisible on %u servers", "251" }, /* 252 */ - { RPL_LUSEROP, "%d :operator(s) online", "252" }, + { RPL_LUSEROP, "%u :operator(s) online", "252" }, /* 253 */ - { RPL_LUSERUNKNOWN, "%d :unknown connection(s)", "253" }, + { RPL_LUSERUNKNOWN, "%u :unknown connection(s)", "253" }, /* 254 */ - { RPL_LUSERCHANNELS, "%d :channels formed", "254" }, + { RPL_LUSERCHANNELS, "%u :channels formed", "254" }, /* 255 */ - { RPL_LUSERME, ":I have %d clients and %d servers", "255" }, + { RPL_LUSERME, ":I have %u clients and %u servers", "255" }, /* 256 */ { RPL_ADMINME, ":Administrative info about %s", "256" }, /* 257 */ @@ -554,7 +554,7 @@ static Numeric replyTable[] = { /* 260 */ { 0 }, /* 261 */ - { RPL_TRACELOG, "File %s %d", "261" }, + { 0 }, /* 262 */ { RPL_TRACEEND, ":End of TRACE", "262" }, /* 263 */ @@ -632,7 +632,7 @@ static Numeric replyTable[] = { /* 299 */ { 0 }, /* 300 */ - { RPL_NONE, 0, "300" }, + { 0 }, /* 301 */ { RPL_AWAY, "%s :%s", "301" }, /* 302 */ @@ -640,7 +640,7 @@ static Numeric replyTable[] = { /* 303 */ { RPL_ISON, ":", "303" }, /* 304 */ - { RPL_TEXT, 0, "304" }, + { 0 }, /* 305 */ { RPL_UNAWAY, ":You are no longer marked as being away", "305" }, /* 306 */ @@ -676,7 +676,7 @@ static Numeric replyTable[] = { /* 321 */ { RPL_LISTSTART, "Channel :Users Name", "321" }, /* 322 */ - { RPL_LIST, "%s %d :%s", "322" }, + { RPL_LIST, "%s %u :%s", "322" }, /* 323 */ { RPL_LISTEND, ":End of /LIST", "323" }, /* 324 */ @@ -754,13 +754,13 @@ static Numeric replyTable[] = { /* 360 */ { 0 }, /* 361 */ - { RPL_KILLDONE, 0, "361" }, /* Not used */ + { 0 }, /* 362 */ { RPL_CLOSING, "%s :Operator enforced Close", "362" }, /* 363 */ { RPL_CLOSEEND, "%d :Connections Closed", "363" }, /* 364 */ - { RPL_LINKS, "%s %s :%d P%u %s", "364" }, + { RPL_LINKS, "%s %s :%u P%u %s", "364" }, /* 365 */ { RPL_ENDOFLINKS, "%s :End of /LINKS list.", "365" }, /* 366 */ @@ -778,7 +778,7 @@ static Numeric replyTable[] = { /* 372 */ { RPL_MOTD, ":- %s", "372" }, /* 373 */ - { RPL_INFOSTART, ":Server INFO", "373" }, + { 0 }, /* 374 */ { RPL_ENDOFINFO, ":End of /INFO list.", "374" }, /* 375 */ @@ -800,9 +800,9 @@ static Numeric replyTable[] = { /* 383 */ { 0 }, /* 384 */ - { RPL_MYPORTIS, "%d :Port to local server is", "384" }, /* not used */ + { 0 }, /* 385 */ - { RPL_NOTOPERANYMORE, 0, "385" }, /* not used */ + { 0 }, /* 386 */ { 0 }, /* 387 */ @@ -832,7 +832,7 @@ static Numeric replyTable[] = { /* 399 */ { 0 }, /* 400 */ - { ERR_FIRSTERROR, "", "400" }, + { 0 }, /* 401 */ { ERR_NOSUCHNICK, "%s :No such nick", "401" }, /* 402 */ diff --git a/ircd/s_stats.c b/ircd/s_stats.c index 940e789..cf5d039 100644 --- a/ircd/s_stats.c +++ b/ircd/s_stats.c @@ -106,7 +106,7 @@ stats_configured_links(struct Client *sptr, const struct StatDesc* sd, if (tmp->status & CONF_UWORLD) send_reply(sptr, RPL_STATSULINE, host); else if (tmp->status & CONF_SERVER) - send_reply(sptr, RPL_STATSCLINE, name, "", "*", port, maximum, hub_limit, get_conf_class(tmp)); + send_reply(sptr, RPL_STATSCLINE, name, port, maximum, hub_limit, get_conf_class(tmp)); else if (tmp->status & CONF_CLIENT) send_reply(sptr, RPL_STATSILINE, (tmp->host ? tmp->host : "*"), maximum,