From: Kevin L. Mitchell Date: Fri, 15 Dec 2000 01:14:59 +0000 (+0000) Subject: Author: Diane Bruce (by way of Kev ) X-Git-Url: http://git.pk910.de/?a=commitdiff_plain;h=eeafbafcedbd5e3f670e8b1010591dc49bf2bc84;p=ircu2.10.12-pk.git Author: Diane Bruce (by way of Kev ) Log message: - rfc1489 is ambigous about how to handle ISON. The example shows no ':' used in the command, which means each nick would appear in parv[1] to parv[n]. After discussion with hop on efnet/undernet it became apparent there is a problem. ircnet gets it right, but they loop over all parv as well as strtoken'ing on ' ' My suggested fix is to loop over each parv[1] to parc, and scanning each one for ' '. I prefer to use parc rather than relying on a parv[] being NULL, but you could do a slightly more efficient version that way. - Trailing spaces are removed, apparently that breaks some ircII clients. epic according to hoppie, is ok, but still... (This patch was applied by hand because of the number of changes involved; hope I got the trailing space behavior correct--I removed all trailing spaces. -Kev) Testing: I tested it; it doesn't crash the server. If ISON gets more than the maximum number of arguments before hitting a colon, the server tries to look up :, but this isn't much of a suprise. Looks nice :) -Kev git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/trunk@338 c9e4aea6-c8fd-4c43-8297-357d70d61c8c --- diff --git a/ChangeLog b/ChangeLog index 1577891..377d3f3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2000-12-14 Kevin L. Mitchell + * ircd/m_ison.c (m_ison): Apply Diane Bruce's patch to make ISON + parse all arguments + * ircd/s_debug.c (count_memory): modify to report for clients and connections, not local clients and remote clients diff --git a/ircd/m_ison.c b/ircd/m_ison.c index bf9779f..e26b0d2 100644 --- a/ircd/m_ison.c +++ b/ircd/m_ison.c @@ -120,21 +120,28 @@ int m_ison(struct Client *cptr, struct Client *sptr, int parc, char *parv[]) char* name; char* p = 0; struct MsgBuf* mb; + int found1 = 0; + int i; if (parc < 2) return need_more_params(sptr, "ISON"); mb = msgq_make(sptr, rpl_str(RPL_ISON), cli_name(&me), cli_name(sptr)); - for (name = ircd_strtok(&p, parv[1], " "); name; - name = ircd_strtok(&p, 0, " ")) { - if ((acptr = FindUser(name))) { - if (msgq_bufleft(mb) < strlen(cli_name(acptr)) + 1) { - send_buffer(sptr, mb, 0); /* send partial response */ - msgq_clean(mb); /* then do another round */ - mb = msgq_make(sptr, rpl_str(RPL_ISON), cli_name(&me), cli_name(sptr)); + for (i = 1; i < parc; i++) { + for (name = ircd_strtok(&p, parv[i], " "); name; + name = ircd_strtok(&p, 0, " ")) { + if ((acptr = FindUser(name))) { + if (msgq_bufleft(mb) < strlen(cli_name(acptr)) + 1) { + send_buffer(sptr, mb, 0); /* send partial response */ + msgq_clean(mb); /* then do another round */ + mb = msgq_make(sptr, rpl_str(RPL_ISON), cli_name(&me), + cli_name(sptr)); + found1 = 0; + } + msgq_append(0, mb, "%s%s", found1 ? " " : "", cli_name(acptr)); + found1++; } - msgq_append(0, mb, "%s ", cli_name(acptr)); /* append nickname */ } }