[cvslog] [CVS] Module eggdrop1.6: Change committed

cvs at eggheads.org cvs at eggheads.org
Mon Jul 12 10:18:20 CST 2010


CVSROOT    : /usr/local/cvsroot
Module     : eggdrop1.6
Commit time: 2010-07-12 16:18:19 UTC
Committer  : Thomas Sader <thommey at gmail.com>

Modified files:
     doc/Changes1.6 src/patch.h src/mod/server.mod/server.c
     src/mod/server.mod/servmsg.c

Log message:

Add sanity check to check-stoned event. Prevents eggdrop from disconnecting in case of drift timers.

---------------------- diff included ----------------------
Index: eggdrop1.6/doc/Changes1.6
diff -u eggdrop1.6/doc/Changes1.6:1.95 eggdrop1.6/doc/Changes1.6:1.96
--- eggdrop1.6/doc/Changes1.6:1.95	Mon Jul 12 09:40:52 2010
+++ eggdrop1.6/doc/Changes1.6	Mon Jul 12 10:18:09 2010
@@ -1,4 +1,4 @@
-$Id: Changes1.6,v 1.95 2010/07/12 15:40:52 thommey Exp $
+$Id: Changes1.6,v 1.96 2010/07/12 16:18:09 thommey Exp $
 
 Eggdrop Changes (since version 1.6.0)
 
@@ -6,6 +6,8 @@
 
 1.6.20 (CVS):
 
+  - Add sanity check to check-stoned event. Prevents eggdrop from
+    disconnecting in case of drift timers.
   - Unwind all nested [vwait] calls before performing a restart.
     Prevents Tcl_Panic() when deleting active interpreter.
   - Make sure traces are looked up in the global scope.
Index: eggdrop1.6/src/mod/server.mod/server.c
diff -u eggdrop1.6/src/mod/server.mod/server.c:1.137 eggdrop1.6/src/mod/server.mod/server.c:1.138
--- eggdrop1.6/src/mod/server.mod/server.c:1.137	Tue Jun 29 09:52:24 2010
+++ eggdrop1.6/src/mod/server.mod/server.c	Mon Jul 12 10:18:09 2010
@@ -2,7 +2,7 @@
  * server.c -- part of server.mod
  *   basic irc server support
  *
- * $Id: server.c,v 1.137 2010/06/29 15:52:24 thommey Exp $
+ * $Id: server.c,v 1.138 2010/07/12 16:18:09 thommey Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -57,7 +57,7 @@
 static int check_stoned;        /* Check for a stoned server? */
 static int serverror_quit;      /* Disconnect from server if ERROR
                                  * messages received? */
-static int waiting_for_awake;   /* set when i unidle myself, cleared when
+static time_t lastpingcheck;    /* set when i unidle myself, cleared when
                                  * i get the response */
 static time_t server_online;    /* server connection time */
 static time_t server_cycle_wait;        /* seconds to wait before
@@ -1582,8 +1582,8 @@
 static void server_5minutely()
 {
   if (check_stoned && server_online) {
-    if (waiting_for_awake) {
-      /* Uh oh!  Never got pong from last time, five minutes ago!
+    if (lastpingcheck && (now - lastpingcheck >= 240)) {
+      /* Still waiting for activity, requested longer than 4 minutes ago.
        * Server is probably stoned.
        */
       int servidx = findanyidx(serv);
@@ -1594,7 +1594,7 @@
     } else if (!trying_server) {
       /* Check for server being stoned. */
       dprintf(DP_MODE, "PING :%li\n", now);
-      waiting_for_awake = 1;
+      lastpingcheck = now;
     }
   }
 }
@@ -1693,7 +1693,7 @@
               keepnick ? " (trying)" : "");
     daysdur(now, server_online, s1);
     egg_snprintf(s, sizeof s, "(connected %s)", s1);
-    if (server_lag && !waiting_for_awake) {
+    if (server_lag && !lastpingcheck) {
       if (server_lag == -1)
         egg_snprintf(s1, sizeof s1, " (bad pong replies)");
       else
@@ -1885,7 +1885,7 @@
   keepnick = 1;
   check_stoned = 1;
   serverror_quit = 1;
-  waiting_for_awake = 0;
+  lastpingcheck = 0;
   server_online = 0;
   server_cycle_wait = 60;
   strcpy(botrealname, "A deranged product of evil coders");
Index: eggdrop1.6/src/mod/server.mod/servmsg.c
diff -u eggdrop1.6/src/mod/server.mod/servmsg.c:1.105 eggdrop1.6/src/mod/server.mod/servmsg.c:1.106
--- eggdrop1.6/src/mod/server.mod/servmsg.c:1.105	Thu Feb 18 03:52:30 2010
+++ eggdrop1.6/src/mod/server.mod/servmsg.c	Mon Jul 12 10:18:09 2010
@@ -1,7 +1,7 @@
 /*
  * servmsg.c -- part of server.mod
  *
- * $Id: servmsg.c,v 1.105 2010/02/18 09:52:30 pseudo Exp $
+ * $Id: servmsg.c,v 1.106 2010/07/12 16:18:09 thommey Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -1119,7 +1119,7 @@
     trying_server = 0;
     SERVER_SOCKET.timeout_val = 0;
   }
-  waiting_for_awake = 0;
+  lastpingcheck = 0;
   from = "";
   if (msg[0] == ':') {
     msg++;
@@ -1253,7 +1253,7 @@
   int servidx;
   unsigned int botserverport = 0;
 
-  waiting_for_awake = 0;
+  lastpingcheck = 0;
   trying_server = now;
   empty_msgq();
   /* Start up the counter (always reset it if "never-give-up" is on) */
Index: eggdrop1.6/src/patch.h
diff -u eggdrop1.6/src/patch.h:1.1255 eggdrop1.6/src/patch.h:1.1256
--- eggdrop1.6/src/patch.h:1.1255	Fri Jul  9 17:29:54 2010
+++ eggdrop1.6/src/patch.h	Mon Jul 12 10:18:09 2010
@@ -10,7 +10,7 @@
  * statement, leave the rest of the file alone, this allows better
  * overlapping patches.
  *
- * $Id: patch.h,v 1.1255 2010/07/09 23:29:54 pseudo Exp $
+ * $Id: patch.h,v 1.1256 2010/07/12 16:18:09 thommey Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -41,12 +41,12 @@
  *
  *
  */
-patch("1278717919");            /* current unixtime */
+patch("1278951196");            /* current unixtime */
 /*
  *
  *
  */
-patch("newstaticchans2");
+patch("driftstoned");
 /*
  *
  *
----------------------- End of diff -----------------------


More information about the Changes mailing list