summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-02-26 20:39:09 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-02-26 20:39:09 +0000
commitf92292e6a03428708373087525a4460ea9130e9f (patch)
treebdc9a8d299ef852fbc85b09cdffbae99710743f9
parent090c1d76e8fdce84fcf35fc5b08442295171aadc (diff)
Made this safer, dont try and yield back when sending channel list or user list (our iterator may become invalid while we're using it!)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3347 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r--src/modules/m_spanningtree.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/modules/m_spanningtree.cpp b/src/modules/m_spanningtree.cpp
index 76630afbb..ff6a9289c 100644
--- a/src/modules/m_spanningtree.cpp
+++ b/src/modules/m_spanningtree.cpp
@@ -1309,10 +1309,6 @@ class TreeSocket : public InspSocket
{
FOREACH_MOD(I_OnSyncChannelMetaData,OnSyncChannelMetaData(c->second,(Module*)TreeProtocolModule,(void*)this,list[j]));
}
- if ((iterations % 20) == 0)
- {
- ServerInstance->DoOneIteration(false);
- }
}
}
@@ -1343,10 +1339,6 @@ class TreeSocket : public InspSocket
{
FOREACH_MOD(I_OnSyncUserMetaData,OnSyncUserMetaData(u->second,(Module*)TreeProtocolModule,(void*)this,list[j]));
}
- if ((iterations % 20) == 0)
- {
- ServerInstance->DoOneIteration(false);
- }
}
}
}
@@ -1358,18 +1350,26 @@ class TreeSocket : public InspSocket
*/
void DoBurst(TreeServer* s)
{
+ /* The calls here to ServerInstance->DoOneIteration(false); yield the processing
+ * back to the core so that a large burst is split into at least 6 sections
+ * (possibly more)
+ */
Srv->SendOpers("*** Bursting to \2"+s->GetName()+"\2.");
this->WriteLine("BURST");
/* send our version string */
this->WriteLine(":"+Srv->GetServerName()+" VERSION :"+Srv->GetVersion());
/* Send server tree */
this->SendServers(TreeRoot,s,1);
+ ServerInstance->DoOneIteration(false);
/* Send users and their oper status */
this->SendUsers(s);
+ ServerInstance->DoOneIteration(false);
/* Send everything else (channel modes, xlines etc) */
this->SendChannelModes(s);
+ ServerInstance->DoOneIteration(false);
this->SendXLines(s);
FOREACH_MOD(I_OnSyncOtherMetaData,OnSyncOtherMetaData((Module*)TreeProtocolModule,(void*)this));
+ ServerInstance->DoOneIteration(false);
this->WriteLine("ENDBURST");
Srv->SendOpers("*** Finished bursting to \2"+s->GetName()+"\2.");
}