diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-03-02 23:03:13 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-03-02 23:03:13 +0000 |
commit | 413f775b8918b74039dcb994f936cdba70cc9322 (patch) | |
tree | 2bf95ba4a315e581f2c99fa1a5161609ae3c01ad | |
parent | 81761626d09537ed2dc45bcf79326c2f1a09f9c7 (diff) |
Fix to prevent recursive call to DoBackgroundTimer
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3441 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r-- | src/inspircd.cpp | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/inspircd.cpp b/src/inspircd.cpp index c52444deb..26f95e2b9 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -616,7 +616,22 @@ void InspIRCd::DoOneIteration(bool process_module_sockets) if (((TIME % 5) == 0) && (!expire_run)) { expire_lines(); - FOREACH_MOD(I_OnBackgroundTimer,OnBackgroundTimer(TIME)); + if (process_module_sockets) + { + /* Fix by brain - the addition of DoOneIteration means that this + * can end up getting called recursively in the following pattern: + * + * m_spanningtree DoPingChecks + * (server pings out and is squit) + * (squit causes call to DoOneIteration) + * DoOneIteration enters here + * calls DoBackground timer + * enters m_spanningtree DoPingChecks... see step 1. + * + * This should do the job and fix the bug. + */ + FOREACH_MOD(I_OnBackgroundTimer,OnBackgroundTimer(TIME)); + } TickMissedTimers(TIME); expire_run = true; return; @@ -633,7 +648,7 @@ void InspIRCd::DoOneIteration(bool process_module_sockets) WriteOpers("*** \002EH?!\002 -- Time is flowing BACKWARDS in this dimension! Clock drifted backwards %d secs.",abs(OLDTIME-TIME)); DoBackgroundUserStuff(TIME); } - + /* Process timeouts on module sockets each time around * the loop. There shouldnt be many module sockets, at * most, 20 or so, so this won't be much of a performance |