Explorar o código

* Don't check for duplicate msgs in the server queue

svn: 1569
Bryan Drewery %!s(int64=21) %!d(string=hai) anos
pai
achega
39eec6bb42
Modificáronse 3 ficheiros con 2 adicións e 35 borrados
  1. 1 0
      doc/UPDATES
  2. 0 4
      src/mod/server.mod/cmdsserv.c
  3. 1 31
      src/mod/server.mod/server.c

+ 1 - 0
doc/UPDATES

@@ -69,6 +69,7 @@ This is a summary of ChangeLog basically.
 * cmd_bots now takes an optional parameter. A nodename (hostname) to match for bots. Down bots are prepended with a *.
 * cmd_bots now takes an optional parameter. A nodename (hostname) to match for bots. Down bots are prepended with a *.
 * Recoded and spiffed up cmd_userlist.
 * Recoded and spiffed up cmd_userlist.
 * When connecting with a floodless iline, bot will now dump msgs instead of queueing them to server.
 * When connecting with a floodless iline, bot will now dump msgs instead of queueing them to server.
+* Removed the checks for duplicate msgs in the queue, they're there for a reason. (also is slow)
 
 
 1.1.9
 1.1.9
 
 

+ 0 - 4
src/mod/server.mod/cmdsserv.c

@@ -82,7 +82,6 @@ static void cmd_clearqueue(int idx, char *par)
     msgq_clear(&modeq);
     msgq_clear(&modeq);
     msgq_clear(&mq);
     msgq_clear(&mq);
     msgq_clear(&hq);
     msgq_clear(&hq);
-    double_warned = 0;
     burst = 0;
     burst = 0;
     dprintf(idx, "Removed %d message%s from all queues.\n", msgs, 
     dprintf(idx, "Removed %d message%s from all queues.\n", msgs, 
         (msgs != 1) ? "s" : "");
         (msgs != 1) ? "s" : "");
@@ -91,13 +90,11 @@ static void cmd_clearqueue(int idx, char *par)
     msgq_clear(&modeq);
     msgq_clear(&modeq);
     if (mq.tot == 0)
     if (mq.tot == 0)
       burst = 0;
       burst = 0;
-    double_warned = 0;
     dprintf(idx, "Removed %d message%s from the mode queue.\n", msgs, 
     dprintf(idx, "Removed %d message%s from the mode queue.\n", msgs, 
         (msgs != 1) ? "s" : "");
         (msgs != 1) ? "s" : "");
   } else if (!egg_strcasecmp(par, "help")) {
   } else if (!egg_strcasecmp(par, "help")) {
     msgs = hq.tot;
     msgs = hq.tot;
     msgq_clear(&hq);
     msgq_clear(&hq);
-    double_warned = 0;
     dprintf(idx, "Removed %d message%s from the help queue.\n", msgs,
     dprintf(idx, "Removed %d message%s from the help queue.\n", msgs,
         (msgs != 1) ? "s" : "");
         (msgs != 1) ? "s" : "");
   } else if (!egg_strcasecmp(par, "server")) {
   } else if (!egg_strcasecmp(par, "server")) {
@@ -105,7 +102,6 @@ static void cmd_clearqueue(int idx, char *par)
     msgq_clear(&mq);
     msgq_clear(&mq);
     if (modeq.tot == 0)
     if (modeq.tot == 0)
       burst = 0;
       burst = 0;
-    double_warned = 0;
     dprintf(idx, "Removed %d message%s from the server queue.\n", msgs,
     dprintf(idx, "Removed %d message%s from the server queue.\n", msgs,
         (msgs != 1) ? "s" : "");
         (msgs != 1) ? "s" : "");
   } else {
   } else {

+ 1 - 31
src/mod/server.mod/server.c

@@ -65,10 +65,6 @@ int answer_ctcp;		/* answer how many stacked ctcp's ? */
 static bool check_mode_r;	/* check for IRCNET +r modes */
 static bool check_mode_r;	/* check for IRCNET +r modes */
 static int net_type;
 static int net_type;
 static bool resolvserv;		/* in the process of resolving a server host */
 static bool resolvserv;		/* in the process of resolving a server host */
-static bool double_mode;		/* allow a msgs to be twice in a queue? */
-static bool double_server;
-static bool double_help;
-static bool double_warned;
 static time_t lastpingtime;	/* IRCNet LAGmeter support -- drummer */
 static time_t lastpingtime;	/* IRCNet LAGmeter support -- drummer */
 static char stackablecmds[511] = "";
 static char stackablecmds[511] = "";
 static char stackable2cmds[511] = "";
 static char stackable2cmds[511] = "";
@@ -500,7 +496,7 @@ void queue_server(int which, char *buf, int len)
 
 
   struct msgq_head *h = NULL, tempq;
   struct msgq_head *h = NULL, tempq;
   struct msgq *q = NULL, *tq = NULL, *tqq = NULL;
   struct msgq *q = NULL, *tq = NULL, *tqq = NULL;
-  int doublemsg = 0, qnext = 0;
+  int qnext = 0;
 
 
   /* No queue for PING and PONG - drummer */
   /* No queue for PING and PONG - drummer */
   if (!egg_strncasecmp(buf, "PING", 4) || !egg_strncasecmp(buf, "PONG", 4)) {
   if (!egg_strncasecmp(buf, "PING", 4) || !egg_strncasecmp(buf, "PONG", 4)) {
@@ -522,8 +518,6 @@ void queue_server(int which, char *buf, int len)
   case DP_MODE:
   case DP_MODE:
     h = &modeq;
     h = &modeq;
     tempq = modeq;
     tempq = modeq;
-    if (double_mode)
-      doublemsg = 1;
     break;
     break;
 
 
   case DP_SERVER_NEXT:
   case DP_SERVER_NEXT:
@@ -532,8 +526,6 @@ void queue_server(int which, char *buf, int len)
   case DP_SERVER:
   case DP_SERVER:
     h = &mq;
     h = &mq;
     tempq = mq;
     tempq = mq;
-    if (double_server)
-      doublemsg = 1;
     break;
     break;
 
 
   case DP_HELP_NEXT:
   case DP_HELP_NEXT:
@@ -542,8 +534,6 @@ void queue_server(int which, char *buf, int len)
   case DP_HELP:
   case DP_HELP:
     h = &hq;
     h = &hq;
     tempq = hq;
     tempq = hq;
-    if (double_help)
-      doublemsg = 1;
     break;
     break;
 
 
   default:
   default:
@@ -552,21 +542,6 @@ void queue_server(int which, char *buf, int len)
   }
   }
 
 
   if (h->tot < maxqmsg) {
   if (h->tot < maxqmsg) {
-    /* Don't queue msg if it's already queued?  */
-    if (!doublemsg)
-      for (tq = tempq.head; tq; tq = tqq) {
-	tqq = tq->next;
-	if (!egg_strcasecmp(tq->msg, buf)) {
-	  if (!double_warned) {
-	    if (buf[len - 1] == '\n')
-	      buf[len - 1] = 0;
-	    debug1("msg already queued. skipping: %s", buf);
-	    double_warned = 1;
-	  }
-	  return;
-	}
-      }
-
     q = (struct msgq *) calloc(1, sizeof(struct msgq));
     q = (struct msgq *) calloc(1, sizeof(struct msgq));
     if (qnext)
     if (qnext)
       q->next = h->head;
       q->next = h->head;
@@ -585,7 +560,6 @@ void queue_server(int which, char *buf, int len)
     strncpyz(q->msg, buf, len + 1);
     strncpyz(q->msg, buf, len + 1);
     h->tot++;
     h->tot++;
     h->warned = 0;
     h->warned = 0;
-    double_warned = 0;
   } else {
   } else {
     if (!h->warned) {
     if (!h->warned) {
       switch (which) {   
       switch (which) {   
@@ -1097,9 +1071,6 @@ void server_init()
   maxqmsg = 300;
   maxqmsg = 300;
   burst = 0;
   burst = 0;
   net_type = NETT_EFNET;
   net_type = NETT_EFNET;
-  double_mode = 0;
-  double_server = 0;
-  double_help = 0;
   use_penalties = 0;
   use_penalties = 0;
   use_fastdeq = 0;
   use_fastdeq = 0;
   stackablecmds[0] = 0;
   stackablecmds[0] = 0;
@@ -1129,7 +1100,6 @@ void server_init()
   mq.last = hq.last = modeq.last = NULL;
   mq.last = hq.last = modeq.last = NULL;
   mq.tot = hq.tot = modeq.tot = 0;
   mq.tot = hq.tot = modeq.tot = 0;
   mq.warned = hq.warned = modeq.warned = 0;
   mq.warned = hq.warned = modeq.warned = 0;
-  double_warned = 0;
   newserver[0] = 0;
   newserver[0] = 0;
   newserverport = 0;
   newserverport = 0;
   curserv = 999;
   curserv = 999;