From: Michael Poole Date: Tue, 4 Jan 2005 00:44:08 +0000 (+0000) Subject: Fix automatic outbound connections (again; hopefully for good). X-Git-Url: http://git.pk910.de/?a=commitdiff_plain;h=d1ee330fb88f78914c6bf2239d93651221895610;p=ircu2.10.12-pk.git Fix automatic outbound connections (again; hopefully for good). git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/trunk@1294 c9e4aea6-c8fd-4c43-8297-357d70d61c8c --- diff --git a/ChangeLog b/ChangeLog index 1cdc2eb..07410e6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,9 @@ -2005-01-13 Michael Poole +2005-01-03 Michael Poole + + * ircd/ircd.c (try_connections): Test Connect hold time before + updating it (spotted by Kev). + +2005-01-03 Michael Poole * Makefile.in: Add ircd/test as a subdirectory. diff --git a/ircd/ircd.c b/ircd/ircd.c index 754ecab..363903e 100644 --- a/ircd/ircd.c +++ b/ircd/ircd.c @@ -248,6 +248,7 @@ static void try_connections(struct Event* ev) { 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 @@ static void try_connections(struct Event* ev) { /* 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) {