-2005-01-13 Michael Poole <mdpoole@troilus.org>
+2005-01-03 Michael Poole <mdpoole@troilus.org>
+
+ * ircd/ircd.c (try_connections): Test Connect hold time before
+ updating it (spotted by Kev).
+
+2005-01-03 Michael Poole <mdpoole@troilus.org>
* Makefile.in: Add ircd/test as a subdirectory.
time_t next = 0;
struct ConnectionClass* cltmp;
struct Jupe* ajupe;
+ int hold;
assert(ET_EXPIRE == ev_type(ev));
assert(0 != ev_timer(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) {