]> jfr.im git - irc/quakenet/snircd-patchqueue.git/blob - checkoutput.patch
welcome: use max variable instead of WELCOME_MAX_ENTRIES and make check for inserting...
[irc/quakenet/snircd-patchqueue.git] / checkoutput.patch
1 make use of the SND_EXPLICIT flag to specify a pattern, reducing most output from 2 lines to 1 line
2 few minor other changes:
3 changed hidden to delayedjoin,
4 changed no modes <none> to just + same as /MODE shows
5 added zombie and delayedjoin prefix to header for check channel
6 changed all (timestamp) output to [timestamp] seems more consistent with other places (e.g. snomask HACK MODEs)
7 added [<remote server>] param to syntax of command in the comments
8
9 diff -r 7eae4cf8f270 ircd/m_check.c
10 --- a/ircd/m_check.c Tue Mar 23 21:53:21 2010 +0100
11 +++ b/ircd/m_check.c Tue Mar 23 21:56:26 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.
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,
69 + ":[%d] - %s - Set by %s, on %s [%Tu]",
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);
97 + send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ": Creation time:: %s [%Tu]",
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);
116 + send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ": Set at:: %s [%Tu]", myctime(chptr->topic_time), chptr->topic_time);
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))
173 + send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ": Signed on:: %s [%Tu]", myctime(acptr->cli_firsttime), acptr->cli_firsttime);
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);
177 + send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ": Timestamp:: %s [%d]", myctime(acptr->cli_lastnick), acptr->cli_lastnick);
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, RPL_DATASTR, ": ");
294 + send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ": Ports:: %d -> %d (client -> server)",
295 + sin.port, cli_listener(acptr)->addr.port);
296 if (feature_bool(FEAT_EXTENDED_CHECKCMD)) {
297 /* Note: sendq = receiveq for a client (it makes sense really) */
298 - ircd_snprintf(0, outbuf, sizeof(outbuf), " Data sent:: %lu.%0.3u Kb (%u protocol messages)",
299 - (unsigned long)cli_receiveB(acptr) / 1024, (unsigned long)cli_receiveB(acptr) % 1024, cli_receiveM(acptr));
300 - send_reply(sptr, RPL_DATASTR, outbuf);
301 - ircd_snprintf(0, outbuf, sizeof(outbuf), " Data received:: %lu.%0.3lu Kb (%u protocol messages)",
302 - (unsigned long)cli_sendB(acptr) / 1024, (unsigned long)cli_sendB(acptr) % 1024, cli_sendM(acptr));
303 - send_reply(sptr, RPL_DATASTR, outbuf);
304 - ircd_snprintf(0, outbuf, sizeof(outbuf), " receiveQ size:: %d bytes (max. %d bytes)",
305 - DBufLength(&(cli_recvQ(acptr))), feature_int(FEAT_CLIENT_FLOOD));
306 - send_reply(sptr, RPL_DATASTR, outbuf);
307 - ircd_snprintf(0, outbuf, sizeof(outbuf), " sendQ size:: %d bytes (max. %d bytes)",
308 - DBufLength(&(cli_sendQ(acptr))), get_sendq(acptr));
309 - send_reply(sptr, RPL_DATASTR, outbuf);
310 + send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ": Data sent:: %lu.%0.3u Kb (%u protocol messages)",
311 + (unsigned long)cli_receiveB(acptr) / 1024, (unsigned long)cli_receiveB(acptr) % 1024, cli_receiveM(acptr));
312 + send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ": Data received:: %lu.%0.3lu Kb (%u protocol messages)",
313 + (unsigned long)cli_sendB(acptr) / 1024, (unsigned long)cli_sendB(acptr) % 1024, cli_sendM(acptr));
314 + send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ": receiveQ size:: %d bytes (max. %d bytes)",
315 + DBufLength(&(cli_recvQ(acptr))), feature_int(FEAT_CLIENT_FLOOD));
316 + send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ": sendQ size:: %d bytes (max. %d bytes)",
317 + DBufLength(&(cli_sendQ(acptr))), get_sendq(acptr));
318 }
319 }
320
321 @@ -571,50 +536,50 @@
322 }
323
324 void checkServer(struct Client *sptr, struct Client *acptr) {
325 - char outbuf[BUFSIZE];
326
327 /* Header */
328 - send_reply(sptr, RPL_DATASTR, " ");
329 - send_reply(sptr, RPL_CHKHEAD, "server", acptr->cli_name);
330 - send_reply(sptr, RPL_DATASTR, " ");
331 + send_reply(sptr, RPL_DATASTR, ": ");
332 + send_reply(sptr, RPL_CHKHEAD, ":server", acptr->cli_name);
333 + send_reply(sptr, RPL_DATASTR, ": ");
334
335 - ircd_snprintf(0, outbuf, sizeof(outbuf), " Connected at:: %s (%Tu)", myctime(acptr->cli_serv->timestamp), acptr->cli_serv->timestamp);
336 - send_reply(sptr, RPL_DATASTR, outbuf);
337 + send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ": Connected at:: %s [%Tu]",
338 + myctime(acptr->cli_serv->timestamp), acptr->cli_serv->timestamp);
339
340 - ircd_snprintf(0, outbuf, sizeof(outbuf), " Server name:: %s", acptr->cli_name);
341 - send_reply(sptr, RPL_DATASTR, outbuf);
342 + send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ": Server name:: %s", acptr->cli_name);
343
344 - ircd_snprintf(0, outbuf, sizeof(outbuf), " Numeric:: %s --> %d", NumServ(acptr), base64toint(acptr->cli_yxx));
345 - send_reply(sptr, RPL_DATASTR, outbuf);
346 + send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ": Numeric:: %s --> %d",
347 + NumServ(acptr), base64toint(acptr->cli_yxx));
348
349 - ircd_snprintf(0, outbuf, sizeof(outbuf), " Users:: %d / %d", (acptr == &me) ? UserStats.local_clients : cli_serv(acptr)->clients,
350 + send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ": Users:: %d / %d",
351 + (acptr == &me) ? UserStats.local_clients : cli_serv(acptr)->clients,
352 base64toint(cli_serv(acptr)->nn_capacity));
353 - send_reply(sptr, RPL_DATASTR, outbuf);
354
355 if (IsBurst(acptr))
356 - send_reply(sptr, RPL_DATASTR, " Status:: Bursting");
357 + send_reply(sptr, RPL_DATASTR, ": Status:: Bursting");
358 else if (IsBurstAck(acptr))
359 - send_reply(sptr, RPL_DATASTR, " Status:: Awaiting EOB Ack");
360 + send_reply(sptr, RPL_DATASTR, ": Status:: Awaiting EOB Ack");
361 else if (IsService(acptr))
362 - send_reply(sptr, RPL_DATASTR, " Status:: Network Service");
363 + send_reply(sptr, RPL_DATASTR, ": Status:: Network Service");
364 else if (IsHub(acptr))
365 - send_reply(sptr, RPL_DATASTR, " Status:: Network Hub");
366 + send_reply(sptr, RPL_DATASTR, ": Status:: Network Hub");
367
368 if (feature_bool(FEAT_EXTENDED_CHECKCMD)) {
369 int dlinkc = 0;
370 struct DLink* slink = NULL;
371
372 - send_reply(sptr, RPL_DATASTR, " ");
373 - send_reply(sptr, RPL_DATASTR, "Downlinks::");
374 - for (slink = cli_serv(acptr)->down; slink; slink = slink->next) {
375 - ircd_snprintf(0, outbuf, sizeof(outbuf), "[%d] - %s%s", ++dlinkc,
376 - IsBurst(slink->value.cptr) ? "*" : IsBurstAck(slink->value.cptr) ? "!" : IsService(slink->value.cptr) ? "=" : IsHub(slink->value.cptr) ? "+" : " ",
377 - cli_name(slink->value.cptr));
378 - send_reply(sptr, RPL_DATASTR, outbuf);
379 - }
380 + send_reply(sptr, RPL_DATASTR, ": ");
381 + send_reply(sptr, RPL_DATASTR, ":Downlinks::");
382 + for (slink = cli_serv(acptr)->down; slink; slink = slink->next)
383 + send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ":[%d] - %s%s",
384 + ++dlinkc,
385 + IsBurst(slink->value.cptr) ? "*" :
386 + (IsBurstAck(slink->value.cptr) ? "!" :
387 + (IsService(slink->value.cptr) ? "=" :
388 + (IsHub(slink->value.cptr) ? "+" : " "))),
389 + cli_name(slink->value.cptr));
390
391 if (!dlinkc)
392 - send_reply(sptr, RPL_DATASTR, "<none>");
393 + send_reply(sptr, RPL_DATASTR, ":<none>");
394 }
395
396 /* Send 'END OF CHECK' message */
397 @@ -626,7 +591,6 @@
398 struct Channel *chptr;
399 struct Membership *lp;
400 int count = 0, found = 0;
401 - char outbuf[BUFSIZE];
402 char targhost[NICKLEN + USERLEN + HOSTLEN + 3], curhost[NICKLEN + USERLEN + HOSTLEN + 3];
403 char hoststr[NICKLEN + USERLEN + HOSTLEN + 3];
404 char nickm[NICKLEN + 1], userm[USERLEN + 1], hostm[HOSTLEN + 1];
405 @@ -686,8 +650,7 @@
406 break;
407
408 if(count >= 500) { /* sanity stuff */
409 - ircd_snprintf(0, outbuf, sizeof(outbuf), "More than %d results, truncating...", count);
410 - send_reply(sptr, RPL_DATASTR, outbuf);
411 + send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ":More than %d results, truncating...", count);
412 break;
413 }
414
415 @@ -718,37 +681,43 @@
416 /* Show header if we've found at least 1 record */
417 if (count == 0) {
418 /* Output header */
419 - send_reply(sptr, RPL_DATASTR, " ");
420 - send_reply(sptr, RPL_CHKHEAD, "host", targhost);
421 + send_reply(sptr, RPL_DATASTR, ": ");
422 + send_reply(sptr, RPL_CHKHEAD, ":host", targhost);
423
424 - send_reply(sptr, RPL_DATASTR, " ");
425 + send_reply(sptr, RPL_DATASTR, ": ");
426 if (flags & CHECK_SHOWMORE)
427 - ircd_snprintf(0, outbuf, sizeof(outbuf), "No. %s nick user@host [IP] (usermodes) :realname", (flags & CHECK_CLONES) ? "[clients]" : "");
428 + send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ":No. %s nick user@host [IP] (usermodes) :realname",
429 + (flags & CHECK_CLONES) ? "[clients]" : "");
430 else
431 - ircd_snprintf(0, outbuf, sizeof(outbuf), "%s %-*s%-*s%s", "No.", (NICKLEN + 2), "Nick",
432 - (USERLEN + 2), "User", "Host");
433 - send_reply(sptr, RPL_DATASTR, outbuf);
434 + send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ":%s %-*s%-*s%s", "No.",
435 + (NICKLEN + 2), "Nick", (USERLEN + 2), "User", "Host");
436 }
437
438 if (flags & CHECK_SHOWMORE) {
439 /* show more information */
440 umodes = umode_str(acptr, UMODE_AND_ACCOUNT_SHORT);
441 - ircd_snprintf(0, outbuf, sizeof(outbuf), "%-4d ", (count+1));
442 if (flags & CHECK_CLONES)
443 - ircd_snprintf(0, outbuf, sizeof(outbuf), "%s[%+3hu] ", outbuf, IPcheck_nr(acptr));
444 - ircd_snprintf(0, outbuf, sizeof(outbuf), "%s%s %s@%s [%s] (%s%s) :%s", outbuf,
445 - acptr->cli_name,
446 - cli_user(acptr)->realusername, cli_user(acptr)->realhost,
447 - ircd_ntoa(&(cli_ip(acptr))),
448 - *umodes ? "+" : "<none>", umodes,
449 - (flags & CHECK_SHOWSERVER) ? cli_name(cli_user(acptr)->server) : cli_info(acptr));
450 - } else {
451 + send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ":%-4d [%+3hu] %s %s@%s [%s] (+%s) :%s",
452 + (count+1),
453 + IPcheck_nr(acptr),
454 + acptr->cli_name,
455 + cli_user(acptr)->realusername, cli_user(acptr)->realhost,
456 + ircd_ntoa(&(cli_ip(acptr))),
457 + umodes,
458 + (flags & CHECK_SHOWSERVER) ? cli_name(cli_user(acptr)->server) : cli_info(acptr));
459 + else
460 + send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ":%-4d %s %s@%s [%s] (+%s) :%s",
461 + (count+1),
462 + acptr->cli_name,
463 + cli_user(acptr)->realusername, cli_user(acptr)->realhost,
464 + ircd_ntoa(&(cli_ip(acptr))),
465 + umodes,
466 + (flags & CHECK_SHOWSERVER) ? cli_name(cli_user(acptr)->server) : cli_info(acptr));
467 + } else
468 /* default output */
469 - ircd_snprintf(0, outbuf, sizeof(outbuf), "%-4d %-*s%-*s%s", (count+1), (NICKLEN + 2),
470 - acptr->cli_name, (USERLEN + 2), cli_user(acptr)->realusername,
471 - (flags & CHECK_SHOWIPS) ? ircd_ntoa(&(cli_ip(acptr))) : cli_user(acptr)->realhost);
472 - }
473 - send_reply(sptr, RPL_DATASTR, outbuf);
474 + send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ":%-4d %-*s%-*s%s",
475 + (count+1), (NICKLEN + 2), acptr->cli_name, (USERLEN + 2), cli_user(acptr)->realusername,
476 + (flags & CHECK_SHOWIPS) ? ircd_ntoa(&(cli_ip(acptr))) : cli_user(acptr)->realhost);
477
478 /* Show channel output (if applicable) - the 50 channel limit sanity check
479 * is specifically to prevent coredumping when someone lamely tries to /check
480 @@ -757,17 +726,17 @@
481 if (flags & CHECK_CHECKCHAN) {
482 if (cli_user(acptr)->joined > 0 && cli_user(acptr)->joined <= 50) {
483 char chntext[BUFSIZE];
484 - int len = strlen(" on channels: ");
485 + int len = strlen(": on channels: ");
486 int mlen = strlen(me.cli_name) + len + strlen(sptr->cli_name);
487 *chntext = '\0';
488
489 - strcpy(chntext, " on channels: ");
490 + strcpy(chntext, ": on channels: ");
491 for (lp = cli_user(acptr)->channel; lp; lp = lp->next_channel) {
492 chptr = lp->channel;
493 if (len + strlen(chptr->chname) + mlen > BUFSIZE - 5) {
494 send_reply(sptr, RPL_DATASTR, chntext);
495 *chntext = '\0';
496 - strcpy(chntext, " on channels: ");
497 + strcpy(chntext, ": on channels: ");
498 len = strlen(chntext);
499 }
500 if (IsDeaf(acptr))
501 @@ -793,7 +762,7 @@
502 if (chntext[0] != '\0')
503 send_reply(sptr, RPL_DATASTR, chntext);
504
505 - send_reply(sptr, RPL_DATASTR, " ");
506 + send_reply(sptr, RPL_DATASTR, ": ");
507 }
508 }
509 count++;
510 @@ -801,11 +770,8 @@
511 }
512
513 if (count > 0) {
514 - send_reply(sptr, RPL_DATASTR, " ");
515 -
516 - ircd_snprintf(0, outbuf, sizeof(outbuf), "Matching records found:: %d", count);
517 - send_reply(sptr, RPL_DATASTR, outbuf);
518 -
519 + send_reply(sptr, RPL_DATASTR, ": ");
520 + send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ":Matching records found:: %d", count);
521 send_reply(sptr, RPL_ENDOFCHECK, " ");
522 }
523
524 diff -r 7eae4cf8f270 ircd/s_err.c
525 --- a/ircd/s_err.c Tue Mar 23 21:53:21 2010 +0100
526 +++ b/ircd/s_err.c Tue Mar 23 21:56:26 2010 +0100
527 @@ -612,7 +612,7 @@
528 /* 289 */
529 { 0 },
530 /* 290 */
531 - { RPL_DATASTR, ":%s", "290" },
532 + { RPL_DATASTR, "%s", "290" },
533 /* 291 */
534 { RPL_ENDOFCHECK, ":%s", "291" },
535 /* 292 */