]> jfr.im git - irc/quakenet/snircd-patchqueue.git/blame - checkoutput.patch
checkmscheck: forgot a ; after protocol_violation()
[irc/quakenet/snircd-patchqueue.git] / checkoutput.patch
CommitLineData
196e2468 1make use of the SND_EXPLICIT flag to specify a pattern, reducing most output from 2 lines to 1 line
2few minor other changes:
3changed hidden to delayedjoin,
4changed no modes <none> to just + same as /MODE shows
5added zombie and delayedjoin prefix to header for check channel
e6ba2a80 6changed all (timestamp) output to [timestamp] seems more consistent with other places (e.g. snomask HACK MODEs)
8195482a 7added [<remote server>] param to syntax of command in the comments
196e2468 8
8195482a 9diff -r 6d652e23a2fb ircd/m_check.c
10--- a/ircd/m_check.c Tue Mar 23 20:14:14 2010 +0100
11+++ b/ircd/m_check.c Tue Mar 23 20:14:59 2010 +0100
12@@ -71,7 +71,7 @@
13 */
14
15 /*
16- * Syntax: CHECK <channel|nick|server|hostmask> [-flags]
17+ * Syntax: CHECK [<remote server>] <channel|nick|server|hostmask> [-flags]
18 *
19 * Where valid flags are:
20 * -c: Show channels when checking a hostmask.
196e2468 21@@ -238,7 +238,7 @@
22 char *zombie, *showlevel;
23
24 if (flags & CHECK_SHOWUSERS) {
25- send_reply(sptr, RPL_DATASTR, "Users (@ = op, + = voice)");
26+ send_reply(sptr, RPL_DATASTR, ":Users (! = zombie, @ = op, + = voice, < = delayedjoin)");
27 }
28
29 if (flags & CHECK_CLONES) {
30@@ -324,89 +324,72 @@
31 cntr++;
32 }
33
34- send_reply(sptr, RPL_DATASTR, " ");
35+ send_reply(sptr, RPL_DATASTR, ": ");
36
37 if (flags & CHECK_CLONES) {
38- ircd_snprintf(0, outbuf, sizeof(outbuf),
39- "Total users:: %d (%d ops, %d voiced, %d clones, %d authed, %d hidden)",
40- cntr, opcntr, vcntr, clones, authed, delayedjoin);
41+ send_reply(sptr, SND_EXPLICIT | RPL_DATASTR,
42+ ":Total users:: %d (%d ops, %d voiced, %d clones, %d authed, %d delayedjoin)",
43+ cntr, opcntr, vcntr, clones, authed, delayedjoin);
44
45 for (lp = chptr->members; lp; lp = lp->next_member) {
46 cli_marker(lp->user) = 0;
47 }
48 } else {
49- ircd_snprintf(0, outbuf, sizeof(outbuf),
50- "Total users:: %d (%d ops, %d voiced, %d authed, %d hidden)",
51- cntr, opcntr, vcntr, authed, delayedjoin);
52+ send_reply(sptr, SND_EXPLICIT | RPL_DATASTR,
53+ ":Total users:: %d (%d ops, %d voiced, %d authed, %d delayedjoin)",
54+ cntr, opcntr, vcntr, authed, delayedjoin);
55 }
56
57- send_reply(sptr, RPL_DATASTR, outbuf);
58- send_reply(sptr, RPL_DATASTR, " ");
59+ send_reply(sptr, RPL_DATASTR, ": ");
60
61 /* Do not display bans if ! flags & CHECK_SHOWUSERS */
62 if (flags & CHECK_SHOWUSERS) {
63- send_reply(sptr, RPL_DATASTR, "Bans on channel::");
64+ send_reply(sptr, RPL_DATASTR, ":Bans on channel::");
65
66 for (ban = chptr->banlist; ban; ban = ban->next) {
67- ircd_snprintf(0, outbuf, sizeof(outbuf), "[%d] - %s - Set by %s, on %s (%Tu)",
68+ send_reply(sptr, SND_EXPLICIT | RPL_DATASTR,
e6ba2a80 69+ ":[%d] - %s - Set by %s, on %s [%Tu]",
196e2468 70 ++bans, ban->banstr, ban->who, myctime(ban->when), ban->when);
71- send_reply(sptr, RPL_DATASTR, outbuf);
72 }
73
74 if (bans == 0)
75- send_reply(sptr, RPL_DATASTR, "<none>");
76+ send_reply(sptr, RPL_DATASTR, ":<none>");
77 }
78
79 send_reply(sptr, RPL_ENDOFCHECK, " ");
80 }
81
82 void checkChannel(struct Client *sptr, struct Channel *chptr) {
83- char outbuf[TOPICLEN + MODEBUFLEN + 64], modebuf[MODEBUFLEN], parabuf[MODEBUFLEN];
84+ char modebuf[MODEBUFLEN], parabuf[MODEBUFLEN];
85
86 /* Header */
87- send_reply(sptr, RPL_DATASTR, " ");
88- send_reply(sptr, RPL_CHKHEAD, "channel", chptr->chname);
89- send_reply(sptr, RPL_DATASTR, " ");
90+ send_reply(sptr, RPL_DATASTR, ": ");
91+ send_reply(sptr, RPL_CHKHEAD, ":channel", chptr->chname);
92+ send_reply(sptr, RPL_DATASTR, ": ");
93
94 /* Creation Time */
95- ircd_snprintf(sptr, outbuf, sizeof(outbuf), " Creation time:: %s (%Tu)", myctime(chptr->creationtime), chptr->creationtime);
96- send_reply(sptr, RPL_DATASTR, outbuf);
e6ba2a80 97+ send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ": Creation time:: %s [%Tu]",
196e2468 98+ myctime(chptr->creationtime), chptr->creationtime);
99
100 /* Topic */
101 if (strlen(chptr->topic) <= 0)
102- send_reply(sptr, RPL_DATASTR, " Topic:: <none>");
103+ send_reply(sptr, RPL_DATASTR, ": Topic:: <none>");
104 else {
105- ircd_snprintf(sptr, outbuf, sizeof(outbuf), " Topic:: %s", chptr->topic);
106- send_reply(sptr, RPL_DATASTR, outbuf);
107+ send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ": Topic:: %s", chptr->topic);
108
109 /* ..set by */
110- ircd_snprintf(sptr, outbuf, sizeof(outbuf), " Set by:: %s", chptr->topic_nick);
111- send_reply(sptr, RPL_DATASTR, outbuf);
112+ send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ": Set by:: %s", chptr->topic_nick);
113
114- ircd_snprintf(sptr, outbuf, sizeof(outbuf), " Set at:: %s (%Tu)", myctime(chptr->topic_time), chptr->topic_time);
115- send_reply(sptr, RPL_DATASTR, outbuf);
e6ba2a80 116+ send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ": Set at:: %s [%Tu]", myctime(chptr->topic_time), chptr->topic_time);
196e2468 117 }
118
119 /* Channel Modes */
120-
121- strcpy(outbuf, "Channel mode(s):: ");
122-
123- modebuf[0] = '\0';
124- parabuf[0] = '\0';
125-
126- channel_modes(sptr, modebuf, parabuf, sizeof(modebuf), chptr, NULL);
127-
128- if(modebuf[1] == '\0')
129- strcat(outbuf, "<none>");
130- else if(*parabuf) {
131- strcat(outbuf, modebuf);
132- strcat(outbuf, " ");
133- strcat(outbuf, parabuf);
134- }
135- else
136- strcat(outbuf, modebuf);
137-
138- send_reply(sptr, RPL_DATASTR, outbuf);
139+ *modebuf = '\0';
140+ *parabuf = '\0';
141+ modebuf[1] = '\0';
142+ channel_modes(sptr, modebuf, parabuf, sizeof(parabuf), chptr, NULL);
143+ send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ":Channel mode(s):: %s %s",
144+ modebuf ? modebuf : "+", parabuf);
145
146 /* Don't send 'END OF CHECK' message, it's sent in checkUsers, which is called after this. */
147 }
148@@ -415,53 +398,45 @@
149 struct Channel *chptr;
150 struct Membership *lp;
151 struct irc_sockaddr sin;
152- char outbuf[BUFSIZE];
153 char *umodes;
154 time_t nowr;
155
156 /* Header */
157- send_reply(sptr, RPL_DATASTR, " ");
158- send_reply(sptr, RPL_CHKHEAD, "user", cli_name(acptr));
159- send_reply(sptr, RPL_DATASTR, " ");
160+ send_reply(sptr, RPL_DATASTR, ": ");
161+ send_reply(sptr, RPL_CHKHEAD, ":user", cli_name(acptr));
162+ send_reply(sptr, RPL_DATASTR, ": ");
163
164- ircd_snprintf(0, outbuf, sizeof(outbuf), " Nick:: %s (%s%s)", cli_name(acptr), NumNick(acptr));
165- send_reply(sptr, RPL_DATASTR, outbuf);
166+ send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ": Nick:: %s (%s%s)", cli_name(acptr), NumNick(acptr));
167
168- if (MyUser(acptr)) {
169- ircd_snprintf(0, outbuf, sizeof(outbuf), " Signed on:: %s (%Tu)", myctime(acptr->cli_firsttime), acptr->cli_firsttime);
170- send_reply(sptr, RPL_DATASTR, outbuf);
171- }
172+ if (MyUser(acptr))
e6ba2a80 173+ send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ": Signed on:: %s [%Tu]", myctime(acptr->cli_firsttime), acptr->cli_firsttime);
196e2468 174
175- ircd_snprintf(0, outbuf, sizeof(outbuf), " Timestamp:: %s (%d)", myctime(acptr->cli_lastnick), acptr->cli_lastnick);
176- send_reply(sptr, RPL_DATASTR, outbuf);
e6ba2a80 177+ send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ": Timestamp:: %s [%d]", myctime(acptr->cli_lastnick), acptr->cli_lastnick);
196e2468 178
179- ircd_snprintf(0, outbuf, sizeof(outbuf), " User/Hostmask:: %s@%s [%s] (Clients: %hu)", cli_user(acptr)->username, cli_user(acptr)->host,
180- ircd_ntoa(&(cli_ip(acptr))), IPcheck_nr(acptr));
181- send_reply(sptr, RPL_DATASTR, outbuf);
182+ send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ": User/Hostmask:: %s@%s [%s] (Clients: %hu)",
183+ cli_user(acptr)->username, cli_user(acptr)->host, ircd_ntoa(&(cli_ip(acptr))), IPcheck_nr(acptr));
184
185- if (IsSetHost(acptr) || HasHiddenHost(acptr)) {
186- ircd_snprintf(0, outbuf, sizeof(outbuf), " Real User/Host:: %s@%s", cli_user(acptr)->realusername, cli_user(acptr)->realhost);
187- send_reply(sptr, RPL_DATASTR, outbuf);
188- }
189+ if (IsSetHost(acptr) || HasHiddenHost(acptr))
190+ send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ": Real User/Host:: %s@%s", cli_user(acptr)->realusername, cli_user(acptr)->realhost);
191
192- ircd_snprintf(0, outbuf, sizeof(outbuf), " Real Name:: %s%c", cli_info(acptr), COLOR_OFF);
193- send_reply(sptr, RPL_DATASTR, outbuf);
194+ /* COLOR_OFF ? */
195+ send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ": Real Name:: %s", cli_info(acptr));
196
197 if( IsService(cli_user(acptr)->server)) {
198 if (IsChannelService(acptr))
199- send_reply(sptr, RPL_DATASTR, " Status:: Network Service");
200+ send_reply(sptr, RPL_DATASTR, ": Status:: Network Service");
201 else if (IsAnOper(acptr))
202- send_reply(sptr, RPL_DATASTR, " Status:: IRC Operator (service) (ID: %s)", cli_user(acptr)->opername ? cli_user(acptr)->opername : "<unknown>");
203+ send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ": Status:: IRC Operator (service) (ID: %s)", cli_user(acptr)->opername ? cli_user(acptr)->opername : "<unknown>");
204 else
205- send_reply(sptr, RPL_DATASTR, " Status:: Client (service)");
206- } else if (IsAnOper(acptr)) {
207- ircd_snprintf(0, outbuf, sizeof(outbuf), " Status:: IRC Operator (ID: %s)", cli_user(acptr)->opername ? cli_user(acptr)->opername : "<unknown>");
208- send_reply(sptr, RPL_DATASTR, outbuf);
209- } else
210- send_reply(sptr, RPL_DATASTR, " Status:: Client");
211+ send_reply(sptr, RPL_DATASTR, ": Status:: Client (service)");
212+ } else if (IsAnOper(acptr))
213+ send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ": Status:: IRC Operator (ID: %s)",
214+ cli_user(acptr)->opername ? cli_user(acptr)->opername : "<unknown>");
215+ else
216+ /* this really needed ? */
217+ send_reply(sptr, RPL_DATASTR, ": Status:: Client");
218
219- ircd_snprintf(0, outbuf, sizeof(outbuf), " Connected to:: %s (Hops: %d)", cli_name(cli_user(acptr)->server), cli_hopcount(acptr));
220- send_reply(sptr, RPL_DATASTR, outbuf);
221+ send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ": Connected to:: %s (Hops: %d)", cli_name(cli_user(acptr)->server), cli_hopcount(acptr));
222
223 /* +s (SERV_NOTICE) is not relayed to us from remote servers,
224 * so we cannot tell if a remote client has that mode set.
225@@ -471,11 +446,10 @@
226
227 /* show the usermodes and account info (but not OperID and sethost) */
228 umodes = umode_str(acptr, UMODE_AND_ACCOUNT);
229- ircd_snprintf(0, outbuf, sizeof(outbuf), " Usermode(s):: %s%s", *umodes ? "+" : "<none>", umodes);
230- send_reply(sptr, RPL_DATASTR, outbuf);
231+ send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ": Usermode(s):: +%s", umodes);
232
233 if (cli_user(acptr)->joined == 0)
234- send_reply(sptr, RPL_DATASTR, " Channel(s):: <none>");
235+ send_reply(sptr, RPL_DATASTR, ": Channel(s):: <none>");
236 else if (cli_user(acptr)->joined > 50) {
237
238 /* NB. As a sanity check, we DO NOT show the individual channels the
239@@ -485,22 +459,21 @@
240 * they are on *that* many).
241 */
242
243- ircd_snprintf(0, outbuf, sizeof(outbuf), " Channel(s):: - (total: %u)", cli_user(acptr)->joined);
244- send_reply(sptr, RPL_DATASTR, outbuf);
245+ send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ": Channel(s):: - (total: %u)", cli_user(acptr)->joined);
246 }
247 else {
248 char chntext[BUFSIZE];
249- int len = strlen(" Channel(s):: ");
250+ int len = strlen(": Channel(s):: ");
251 int mlen = strlen(me.cli_name) + len + strlen(cli_name(sptr));
252 *chntext = '\0';
253
254- strcpy(chntext, " Channel(s):: ");
255+ strcpy(chntext, ": Channel(s):: ");
256 for (lp = cli_user(acptr)->channel; lp; lp = lp->next_channel) {
257 chptr = lp->channel;
258 if (len + strlen(chptr->chname) + mlen > BUFSIZE - 5) {
259 send_reply(sptr, RPL_DATASTR, chntext);
260 *chntext = '\0';
261- strcpy(chntext, " Channel(s):: ");
262+ strcpy(chntext, ": Channel(s):: ");
263 len = strlen(chntext);
264 }
265 if (IsDeaf(acptr))
266@@ -530,39 +503,31 @@
267
268 if (MyUser(acptr)) {
269 nowr = CurrentTime - cli_user(acptr)->last;
270- ircd_snprintf(0, outbuf, sizeof(outbuf), " Idle for:: %d days, %02ld:%02ld:%02ld",
271- nowr / 86400, (nowr / 3600) % 24, (nowr / 60) % 60, nowr % 60);
272- send_reply(sptr, RPL_DATASTR, outbuf);
273+ send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ": Idle for:: %d days, %02ld:%02ld:%02ld",
274+ nowr / 86400, (nowr / 3600) % 24, (nowr / 60) % 60, nowr % 60);
275 }
276
277 /* Away message (if applicable) */
278- if (cli_user(acptr)->away) {
279- ircd_snprintf(0, outbuf, sizeof(outbuf), " Away message:: %s", cli_user(acptr)->away);
280- send_reply(sptr, RPL_DATASTR, outbuf);
281- }
282+ if (cli_user(acptr)->away)
283+ send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ": Away message:: %s", cli_user(acptr)->away);
284
285 /* If local user.. */
286 if (MyUser(acptr)) {
287 os_get_peername(con_fd(cli_connect(sptr)), &sin);
288
289 send_reply(sptr, RPL_DATASTR, " ");
290- ircd_snprintf(0, outbuf, sizeof(outbuf), " Ports:: %d -> %d (client -> server)",
291- sin.port, cli_listener(acptr)->addr.port);
292- send_reply(sptr, RPL_DATASTR, outbuf);
293+ send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ": Ports:: %d -> %d (client -> server)",
294+ sin.port, cli_listener(acptr)->addr.port);
295 if (feature_bool(FEAT_EXTENDED_CHECKCMD)) {
296 /* Note: sendq = receiveq for a client (it makes sense really) */
297- ircd_snprintf(0, outbuf, sizeof(outbuf), " Data sent:: %lu.%0.3u Kb (%u protocol messages)",
298- (unsigned long)cli_receiveB(acptr) / 1024, (unsigned long)cli_receiveB(acptr) % 1024, cli_receiveM(acptr));
299- send_reply(sptr, RPL_DATASTR, outbuf);
300- ircd_snprintf(0, outbuf, sizeof(outbuf), " Data received:: %lu.%0.3lu Kb (%u protocol messages)",
301- (unsigned long)cli_sendB(acptr) / 1024, (unsigned long)cli_sendB(acptr) % 1024, cli_sendM(acptr));
302- send_reply(sptr, RPL_DATASTR, outbuf);
303- ircd_snprintf(0, outbuf, sizeof(outbuf), " receiveQ size:: %d bytes (max. %d bytes)",
304- DBufLength(&(cli_recvQ(acptr))), feature_int(FEAT_CLIENT_FLOOD));
305- send_reply(sptr, RPL_DATASTR, outbuf);
306- ircd_snprintf(0, outbuf, sizeof(outbuf), " sendQ size:: %d bytes (max. %d bytes)",
307- DBufLength(&(cli_sendQ(acptr))), get_sendq(acptr));
308- send_reply(sptr, RPL_DATASTR, outbuf);
309+ send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ": Data sent:: %lu.%0.3u Kb (%u protocol messages)",
310+ (unsigned long)cli_receiveB(acptr) / 1024, (unsigned long)cli_receiveB(acptr) % 1024, cli_receiveM(acptr));
311+ send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ": Data received:: %lu.%0.3lu Kb (%u protocol messages)",
312+ (unsigned long)cli_sendB(acptr) / 1024, (unsigned long)cli_sendB(acptr) % 1024, cli_sendM(acptr));
313+ send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ": receiveQ size:: %d bytes (max. %d bytes)",
314+ DBufLength(&(cli_recvQ(acptr))), feature_int(FEAT_CLIENT_FLOOD));
315+ send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ": sendQ size:: %d bytes (max. %d bytes)",
316+ DBufLength(&(cli_sendQ(acptr))), get_sendq(acptr));
317 }
318 }
319
320@@ -571,50 +536,50 @@
321 }
322
323 void checkServer(struct Client *sptr, struct Client *acptr) {
324- char outbuf[BUFSIZE];
325
326 /* Header */
327- send_reply(sptr, RPL_DATASTR, " ");
328- send_reply(sptr, RPL_CHKHEAD, "server", acptr->cli_name);
329- send_reply(sptr, RPL_DATASTR, " ");
330+ send_reply(sptr, RPL_DATASTR, ": ");
331+ send_reply(sptr, RPL_CHKHEAD, ":server", acptr->cli_name);
332+ send_reply(sptr, RPL_DATASTR, ": ");
333
334- ircd_snprintf(0, outbuf, sizeof(outbuf), " Connected at:: %s (%Tu)", myctime(acptr->cli_serv->timestamp), acptr->cli_serv->timestamp);
335- send_reply(sptr, RPL_DATASTR, outbuf);
e6ba2a80 336+ send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ": Connected at:: %s [%Tu]",
196e2468 337+ myctime(acptr->cli_serv->timestamp), acptr->cli_serv->timestamp);
338
339- ircd_snprintf(0, outbuf, sizeof(outbuf), " Server name:: %s", acptr->cli_name);
340- send_reply(sptr, RPL_DATASTR, outbuf);
341+ send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ": Server name:: %s", acptr->cli_name);
342
343- ircd_snprintf(0, outbuf, sizeof(outbuf), " Numeric:: %s --> %d", NumServ(acptr), base64toint(acptr->cli_yxx));
344- send_reply(sptr, RPL_DATASTR, outbuf);
345+ send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ": Numeric:: %s --> %d",
346+ NumServ(acptr), base64toint(acptr->cli_yxx));
347
348- ircd_snprintf(0, outbuf, sizeof(outbuf), " Users:: %d / %d", (acptr == &me) ? UserStats.local_clients : cli_serv(acptr)->clients,
349+ send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ": Users:: %d / %d",
350+ (acptr == &me) ? UserStats.local_clients : cli_serv(acptr)->clients,
351 base64toint(cli_serv(acptr)->nn_capacity));
352- send_reply(sptr, RPL_DATASTR, outbuf);
353
354 if (IsBurst(acptr))
355- send_reply(sptr, RPL_DATASTR, " Status:: Bursting");
356+ send_reply(sptr, RPL_DATASTR, ": Status:: Bursting");
357 else if (IsBurstAck(acptr))
358- send_reply(sptr, RPL_DATASTR, " Status:: Awaiting EOB Ack");
359+ send_reply(sptr, RPL_DATASTR, ": Status:: Awaiting EOB Ack");
360 else if (IsService(acptr))
361- send_reply(sptr, RPL_DATASTR, " Status:: Network Service");
362+ send_reply(sptr, RPL_DATASTR, ": Status:: Network Service");
363 else if (IsHub(acptr))
364- send_reply(sptr, RPL_DATASTR, " Status:: Network Hub");
365+ send_reply(sptr, RPL_DATASTR, ": Status:: Network Hub");
366
367 if (feature_bool(FEAT_EXTENDED_CHECKCMD)) {
368 int dlinkc = 0;
369 struct DLink* slink = NULL;
370
371- send_reply(sptr, RPL_DATASTR, " ");
372- send_reply(sptr, RPL_DATASTR, "Downlinks::");
373- for (slink = cli_serv(acptr)->down; slink; slink = slink->next) {
374- ircd_snprintf(0, outbuf, sizeof(outbuf), "[%d] - %s%s", ++dlinkc,
375- IsBurst(slink->value.cptr) ? "*" : IsBurstAck(slink->value.cptr) ? "!" : IsService(slink->value.cptr) ? "=" : IsHub(slink->value.cptr) ? "+" : " ",
376- cli_name(slink->value.cptr));
377- send_reply(sptr, RPL_DATASTR, outbuf);
378- }
379+ send_reply(sptr, RPL_DATASTR, ": ");
380+ send_reply(sptr, RPL_DATASTR, ":Downlinks::");
381+ for (slink = cli_serv(acptr)->down; slink; slink = slink->next)
382+ send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ":[%d] - %s%s",
383+ ++dlinkc,
384+ IsBurst(slink->value.cptr) ? "*" :
385+ (IsBurstAck(slink->value.cptr) ? "!" :
386+ (IsService(slink->value.cptr) ? "=" :
387+ (IsHub(slink->value.cptr) ? "+" : " "))),
388+ cli_name(slink->value.cptr));
389
390 if (!dlinkc)
391- send_reply(sptr, RPL_DATASTR, "<none>");
392+ send_reply(sptr, RPL_DATASTR, ":<none>");
393 }
394
395 /* Send 'END OF CHECK' message */
396@@ -626,7 +591,6 @@
397 struct Channel *chptr;
398 struct Membership *lp;
399 int count = 0, found = 0;
400- char outbuf[BUFSIZE];
401 char targhost[NICKLEN + USERLEN + HOSTLEN + 3], curhost[NICKLEN + USERLEN + HOSTLEN + 3];
402 char hoststr[NICKLEN + USERLEN + HOSTLEN + 3];
403 char nickm[NICKLEN + 1], userm[USERLEN + 1], hostm[HOSTLEN + 1];
404@@ -686,8 +650,7 @@
405 break;
406
407 if(count >= 500) { /* sanity stuff */
408- ircd_snprintf(0, outbuf, sizeof(outbuf), "More than %d results, truncating...", count);
409- send_reply(sptr, RPL_DATASTR, outbuf);
410+ send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ":More than %d results, truncating...", count);
411 break;
412 }
413
414@@ -718,37 +681,43 @@
415 /* Show header if we've found at least 1 record */
416 if (count == 0) {
417 /* Output header */
418- send_reply(sptr, RPL_DATASTR, " ");
419- send_reply(sptr, RPL_CHKHEAD, "host", targhost);
420+ send_reply(sptr, RPL_DATASTR, ": ");
421+ send_reply(sptr, RPL_CHKHEAD, ":host", targhost);
422
423- send_reply(sptr, RPL_DATASTR, " ");
424+ send_reply(sptr, RPL_DATASTR, ": ");
425 if (flags & CHECK_SHOWMORE)
426- ircd_snprintf(0, outbuf, sizeof(outbuf), "No. %s nick user@host [IP] (usermodes) :realname", (flags & CHECK_CLONES) ? "[clients]" : "");
427+ send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ":No. %s nick user@host [IP] (usermodes) :realname",
428+ (flags & CHECK_CLONES) ? "[clients]" : "");
429 else
430- ircd_snprintf(0, outbuf, sizeof(outbuf), "%s %-*s%-*s%s", "No.", (NICKLEN + 2), "Nick",
431- (USERLEN + 2), "User", "Host");
432- send_reply(sptr, RPL_DATASTR, outbuf);
433+ send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ":%s %-*s%-*s%s", "No.",
434+ (NICKLEN + 2), "Nick", (USERLEN + 2), "User", "Host");
435 }
436
437 if (flags & CHECK_SHOWMORE) {
438 /* show more information */
439 umodes = umode_str(acptr, UMODE_AND_ACCOUNT_SHORT);
440- ircd_snprintf(0, outbuf, sizeof(outbuf), "%-4d ", (count+1));
441 if (flags & CHECK_CLONES)
442- ircd_snprintf(0, outbuf, sizeof(outbuf), "%s[%+3hu] ", outbuf, IPcheck_nr(acptr));
443- ircd_snprintf(0, outbuf, sizeof(outbuf), "%s%s %s@%s [%s] (%s%s) :%s", outbuf,
444- acptr->cli_name,
445- cli_user(acptr)->realusername, cli_user(acptr)->realhost,
446- ircd_ntoa(&(cli_ip(acptr))),
447- *umodes ? "+" : "<none>", umodes,
448- (flags & CHECK_SHOWSERVER) ? cli_name(cli_user(acptr)->server) : cli_info(acptr));
449- } else {
450+ send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ":%-4d [%+3hu] %s %s@%s [%s] (+%s) :%s",
451+ (count+1),
452+ IPcheck_nr(acptr),
453+ acptr->cli_name,
454+ cli_user(acptr)->realusername, cli_user(acptr)->realhost,
455+ ircd_ntoa(&(cli_ip(acptr))),
456+ umodes,
457+ (flags & CHECK_SHOWSERVER) ? cli_name(cli_user(acptr)->server) : cli_info(acptr));
458+ else
459+ send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ":%-4d %s %s@%s [%s] (+%s) :%s",
460+ (count+1),
461+ acptr->cli_name,
462+ cli_user(acptr)->realusername, cli_user(acptr)->realhost,
463+ ircd_ntoa(&(cli_ip(acptr))),
464+ umodes,
465+ (flags & CHECK_SHOWSERVER) ? cli_name(cli_user(acptr)->server) : cli_info(acptr));
466+ } else
467 /* default output */
468- ircd_snprintf(0, outbuf, sizeof(outbuf), "%-4d %-*s%-*s%s", (count+1), (NICKLEN + 2),
469- acptr->cli_name, (USERLEN + 2), cli_user(acptr)->realusername,
470- (flags & CHECK_SHOWIPS) ? ircd_ntoa(&(cli_ip(acptr))) : cli_user(acptr)->realhost);
471- }
472- send_reply(sptr, RPL_DATASTR, outbuf);
473+ send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ":%-4d %-*s%-*s%s",
474+ (count+1), (NICKLEN + 2), acptr->cli_name, (USERLEN + 2), cli_user(acptr)->realusername,
475+ (flags & CHECK_SHOWIPS) ? ircd_ntoa(&(cli_ip(acptr))) : cli_user(acptr)->realhost);
476
477 /* Show channel output (if applicable) - the 50 channel limit sanity check
478 * is specifically to prevent coredumping when someone lamely tries to /check
479@@ -757,17 +726,17 @@
480 if (flags & CHECK_CHECKCHAN) {
481 if (cli_user(acptr)->joined > 0 && cli_user(acptr)->joined <= 50) {
482 char chntext[BUFSIZE];
483- int len = strlen(" on channels: ");
484+ int len = strlen(": on channels: ");
485 int mlen = strlen(me.cli_name) + len + strlen(sptr->cli_name);
486 *chntext = '\0';
487
488- strcpy(chntext, " on channels: ");
489+ strcpy(chntext, ": on channels: ");
490 for (lp = cli_user(acptr)->channel; lp; lp = lp->next_channel) {
491 chptr = lp->channel;
492 if (len + strlen(chptr->chname) + mlen > BUFSIZE - 5) {
493 send_reply(sptr, RPL_DATASTR, chntext);
494 *chntext = '\0';
495- strcpy(chntext, " on channels: ");
496+ strcpy(chntext, ": on channels: ");
497 len = strlen(chntext);
498 }
499 if (IsDeaf(acptr))
500@@ -793,7 +762,7 @@
501 if (chntext[0] != '\0')
502 send_reply(sptr, RPL_DATASTR, chntext);
503
504- send_reply(sptr, RPL_DATASTR, " ");
505+ send_reply(sptr, RPL_DATASTR, ": ");
506 }
507 }
508 count++;
509@@ -801,11 +770,8 @@
510 }
511
512 if (count > 0) {
513- send_reply(sptr, RPL_DATASTR, " ");
514-
515- ircd_snprintf(0, outbuf, sizeof(outbuf), "Matching records found:: %d", count);
516- send_reply(sptr, RPL_DATASTR, outbuf);
517-
518+ send_reply(sptr, RPL_DATASTR, ": ");
519+ send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ":Matching records found:: %d", count);
520 send_reply(sptr, RPL_ENDOFCHECK, " ");
521 }
522
8195482a 523diff -r 6d652e23a2fb ircd/s_err.c
524--- a/ircd/s_err.c Tue Mar 23 20:14:14 2010 +0100
525+++ b/ircd/s_err.c Tue Mar 23 20:14:59 2010 +0100
196e2468 526@@ -612,7 +612,7 @@
527 /* 289 */
528 { 0 },
529 /* 290 */
530- { RPL_DATASTR, ":%s", "290" },
531+ { RPL_DATASTR, "%s", "290" },
532 /* 291 */
533 { RPL_ENDOFCHECK, ":%s", "291" },
534 /* 292 */