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
9 diff -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
16 - * Syntax: CHECK <channel|nick|server|hostmask> [-flags]
17 + * Syntax: CHECK [<remote server>] <channel|nick|server|hostmask> [-flags]
19 * Where valid flags are:
20 * -c: Show channels when checking a hostmask.
22 char *zombie, *showlevel;
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)");
29 if (flags & CHECK_CLONES) {
34 - send_reply(sptr, RPL_DATASTR, " ");
35 + send_reply(sptr, RPL_DATASTR, ": ");
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);
45 for (lp = chptr->members; lp; lp = lp->next_member) {
46 cli_marker(lp->user) = 0;
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);
57 - send_reply(sptr, RPL_DATASTR, outbuf);
58 - send_reply(sptr, RPL_DATASTR, " ");
59 + send_reply(sptr, RPL_DATASTR, ": ");
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::");
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);
75 - send_reply(sptr, RPL_DATASTR, "<none>");
76 + send_reply(sptr, RPL_DATASTR, ":<none>");
79 send_reply(sptr, RPL_ENDOFCHECK, " ");
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];
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, ": ");
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);
101 if (strlen(chptr->topic) <= 0)
102 - send_reply(sptr, RPL_DATASTR, " Topic:: <none>");
103 + send_reply(sptr, RPL_DATASTR, ": Topic:: <none>");
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);
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);
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);
121 - strcpy(outbuf, "Channel mode(s):: ");
126 - channel_modes(sptr, modebuf, parabuf, sizeof(modebuf), chptr, NULL);
128 - if(modebuf[1] == '\0')
129 - strcat(outbuf, "<none>");
130 - else if(*parabuf) {
131 - strcat(outbuf, modebuf);
132 - strcat(outbuf, " ");
133 - strcat(outbuf, parabuf);
136 - strcat(outbuf, modebuf);
138 - send_reply(sptr, RPL_DATASTR, outbuf);
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);
146 /* Don't send 'END OF CHECK' message, it's sent in checkUsers, which is called after this. */
148 @@ -415,53 +398,45 @@
149 struct Channel *chptr;
150 struct Membership *lp;
151 struct irc_sockaddr sin;
152 - char outbuf[BUFSIZE];
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, ": ");
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));
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);
173 + send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ": Signed on:: %s [%Tu]", myctime(acptr->cli_firsttime), acptr->cli_firsttime);
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);
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));
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);
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);
192 - ircd_snprintf(0, outbuf, sizeof(outbuf), " Real Name:: %s%c", cli_info(acptr), COLOR_OFF);
193 - send_reply(sptr, RPL_DATASTR, outbuf);
195 + send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ": Real Name:: %s", cli_info(acptr));
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>");
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);
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>");
216 + /* this really needed ? */
217 + send_reply(sptr, RPL_DATASTR, ": Status:: Client");
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));
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 @@
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);
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) {
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).
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);
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));
254 - strcpy(chntext, " Channel(s):: ");
255 + strcpy(chntext, ": Channel(s):: ");
256 for (lp = cli_user(acptr)->channel; lp; lp = lp->next_channel) {
258 if (len + strlen(chptr->chname) + mlen > BUFSIZE - 5) {
259 send_reply(sptr, RPL_DATASTR, chntext);
261 - strcpy(chntext, " Channel(s):: ");
262 + strcpy(chntext, ": Channel(s):: ");
263 len = strlen(chntext);
266 @@ -530,39 +503,31 @@
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);
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);
282 + if (cli_user(acptr)->away)
283 + send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ": Away message:: %s", cli_user(acptr)->away);
285 /* If local user.. */
287 os_get_peername(con_fd(cli_connect(sptr)), &sin);
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));
320 @@ -571,50 +536,50 @@
323 void checkServer(struct Client *sptr, struct Client *acptr) {
324 - char outbuf[BUFSIZE];
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, ": ");
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);
336 + send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ": Connected at:: %s [%Tu]",
337 + myctime(acptr->cli_serv->timestamp), acptr->cli_serv->timestamp);
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);
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));
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);
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");
367 if (feature_bool(FEAT_EXTENDED_CHECKCMD)) {
369 struct DLink* slink = NULL;
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);
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",
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));
391 - send_reply(sptr, RPL_DATASTR, "<none>");
392 + send_reply(sptr, RPL_DATASTR, ":<none>");
395 /* Send 'END OF CHECK' message */
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];
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);
414 @@ -718,37 +681,43 @@
415 /* Show header if we've found at least 1 record */
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);
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]" : "");
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");
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,
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));
450 + send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ":%-4d [%+3hu] %s %s@%s [%s] (+%s) :%s",
454 + cli_user(acptr)->realusername, cli_user(acptr)->realhost,
455 + ircd_ntoa(&(cli_ip(acptr))),
457 + (flags & CHECK_SHOWSERVER) ? cli_name(cli_user(acptr)->server) : cli_info(acptr));
459 + send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ":%-4d %s %s@%s [%s] (+%s) :%s",
462 + cli_user(acptr)->realusername, cli_user(acptr)->realhost,
463 + ircd_ntoa(&(cli_ip(acptr))),
465 + (flags & CHECK_SHOWSERVER) ? cli_name(cli_user(acptr)->server) : cli_info(acptr));
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);
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);
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);
488 - strcpy(chntext, " on channels: ");
489 + strcpy(chntext, ": on channels: ");
490 for (lp = cli_user(acptr)->channel; lp; lp = lp->next_channel) {
492 if (len + strlen(chptr->chname) + mlen > BUFSIZE - 5) {
493 send_reply(sptr, RPL_DATASTR, chntext);
495 - strcpy(chntext, " on channels: ");
496 + strcpy(chntext, ": on channels: ");
497 len = strlen(chntext);
501 if (chntext[0] != '\0')
502 send_reply(sptr, RPL_DATASTR, chntext);
504 - send_reply(sptr, RPL_DATASTR, " ");
505 + send_reply(sptr, RPL_DATASTR, ": ");
513 - send_reply(sptr, RPL_DATASTR, " ");
515 - ircd_snprintf(0, outbuf, sizeof(outbuf), "Matching records found:: %d", count);
516 - send_reply(sptr, RPL_DATASTR, outbuf);
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, " ");
523 diff -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
530 - { RPL_DATASTR, ":%s", "290" },
531 + { RPL_DATASTR, "%s", "290" },
533 { RPL_ENDOFCHECK, ":%s", "291" },