Committer  : entrope
CVSROOT    : /cvsroot/undernet-ircu
Module     : ircu2.10
Commit time: 2005-01-04 00:44:18 UTC

Modified files:
     ChangeLog ircd/ircd.c

Log message:

Fix automatic outbound connections (again; hopefully for good).

---------------------- diff included ----------------------
Index: ircu2.10/ChangeLog
diff -u ircu2.10/ChangeLog:1.530 ircu2.10/ChangeLog:1.531
--- ircu2.10/ChangeLog:1.530    Mon Jan  3 16:17:10 2005
+++ ircu2.10/ChangeLog  Mon Jan  3 16:44:07 2005
@@ -1,4 +1,9 @@
-2005-01-13  Michael Poole <[EMAIL PROTECTED]>
+2005-01-03  Michael Poole <[EMAIL PROTECTED]>
+
+       * ircd/ircd.c (try_connections): Test Connect hold time before
+       updating it (spotted by Kev).
+
+2005-01-03  Michael Poole <[EMAIL PROTECTED]>
 
        * Makefile.in: Add ircd/test as a subdirectory.
 
Index: ircu2.10/ircd/ircd.c
diff -u ircu2.10/ircd/ircd.c:1.78 ircu2.10/ircd/ircd.c:1.79
--- ircu2.10/ircd/ircd.c:1.78   Mon Jan  3 15:49:32 2005
+++ ircu2.10/ircd/ircd.c        Mon Jan  3 16:44:08 2005
@@ -19,7 +19,7 @@
  */
 /** @file
  * @brief Entry point and other initialization functions for the daemon.
- * @version $Id: ircd.c,v 1.78 2005/01/03 23:49:32 entrope Exp $
+ * @version $Id: ircd.c,v 1.79 2005/01/04 00:44:08 entrope Exp $
  */
 #include "config.h"
 
@@ -248,6 +248,7 @@
   time_t            next        = 0;
   struct ConnectionClass* cltmp;
   struct Jupe*      ajupe;
+  int hold;
 
   assert(ET_EXPIRE == ev_type(ev));
   assert(0 != ev_timer(ev));
@@ -269,17 +270,19 @@
 
     /* Update the next time we can consider this entry. */
     cltmp = aconf->conn_class;
+    hold = aconf->hold > CurrentTime; /* before we update aconf->hold */
     aconf->hold = ConFreq(cltmp) ? CurrentTime + ConFreq(cltmp) : 0;
 
     /* Do not try to connect if its use is still on hold until future,
      * too many links in its connection class, it is already linked,
      * or if connect rules forbid a link now.
      */
-    if ((aconf->hold > CurrentTime)
+    if (hold
         || (Links(cltmp) >= MaxLinks(cltmp))
         || FindServer(aconf->name)
-        || conf_eval_crule(aconf->name, CRULE_MASK))
+        || conf_eval_crule(aconf->name, CRULE_MASK)) {
       continue;
+    }
 
     /* Ensure it is at the end of the list for future checks. */
     if (aconf->next) {
----------------------- End of diff -----------------------

Reply via email to