added gnutls backend and moved backend code into new files
[ircu2.10.12-pk.git] / ircd / m_asll.c
index 5da2c87cbba9b0cac49c7eb0fb5ebc7ba6eaf997..f8ec56066ae365e5c643aa1ce29da09eaa3d360a 100644 (file)
@@ -83,6 +83,7 @@
 #include "client.h"
 #include "hash.h"
 #include "ircd.h"
+#include "ircd_log.h"
 #include "ircd_reply.h"
 #include "ircd_string.h"
 #include "numeric.h"
@@ -93,7 +94,7 @@
 #include "s_bsd.h"
 #include "s_user.h"
 
-#include <assert.h>
+/* #include <assert.h> -- Now using assert in ircd_log.h */
 #include <stdlib.h>
 
 static int send_asll_reply(struct Client *from, struct Client *to, char *server,
@@ -114,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)
@@ -134,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;
 }
 
@@ -152,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)
@@ -164,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;
 }