From 7159e7e3cfbb3c8de417c09d1f39aeb2dbcab3ee Mon Sep 17 00:00:00 2001 From: Michael Poole Date: Wed, 28 Mar 2007 04:04:32 +0000 Subject: [PATCH] Add new line to ASLL output to resolve SF bug #1687382. git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/branches/u2_10_12_branch@1793 c9e4aea6-c8fd-4c43-8297-357d70d61c8c --- ChangeLog | 7 +++++++ ircd/m_asll.c | 10 ++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3166424..6bd9edf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2007-03-28 Michael Poole + + * ircd/m_asll.c (ms_asll): Count hits and report at the end, so + that a client is told whether any match (and has a hint that only + directly linked servers are checked). + (mo_asll): Likewise. + 2007-03-26 Michael Poole * ircd/s_stats.c (m_stats): Move check for STAT_FLAG_LOCONLY (and diff --git a/ircd/m_asll.c b/ircd/m_asll.c index cfe1e41..f8ec560 100644 --- a/ircd/m_asll.c +++ b/ircd/m_asll.c @@ -115,6 +115,7 @@ int ms_asll(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) { char *mask; struct Client *acptr; + int hits; int i; if (parc < 2) @@ -135,14 +136,16 @@ int ms_asll(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) return 0; mask = parv[1]; - for (i = 0; i <= HighestFd; i++) { + for (i = hits = 0; i <= HighestFd; i++) { acptr = LocalClientArray[i]; if (!acptr || !IsServer(acptr) || !MyConnect(acptr) || match(mask, cli_name(acptr))) continue; sendcmdto_prio_one(&me, CMD_ASLL, sptr, "%C %s %i %i %i", sptr, cli_name(acptr), cli_serv(acptr)->asll_rtt, cli_serv(acptr)->asll_to, cli_serv(acptr)->asll_from); + hits++; } + sendcmdto_one(&me, CMD_NOTICE, sptr, "%C :AsLL for %s: %d local servers matched", sptr, mask, hits); return 0; } @@ -153,6 +156,7 @@ int mo_asll(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) { char *mask; struct Client *acptr; + int hits; int i; if (parc < 2) @@ -165,12 +169,14 @@ int mo_asll(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) return 0; mask = parv[1]; - for (i = 0; i <= HighestFd; i++) { + for (i = hits = 0; i <= HighestFd; i++) { acptr = LocalClientArray[i]; if (!acptr || !IsServer(acptr) || !MyConnect(acptr) || match(mask, cli_name(acptr))) continue; send_asll_reply(&me, sptr, cli_name(acptr), cli_serv(acptr)->asll_rtt, cli_serv(acptr)->asll_to, cli_serv(acptr)->asll_from); + hits++; } + sendcmdto_one(&me, CMD_NOTICE, sptr, "%C :AsLL for %s: %d local servers matched", sptr, mask, hits); return 0; } -- 2.20.1