From f92292e6a03428708373087525a4460ea9130e9f Mon Sep 17 00:00:00 2001 From: brain Date: Sun, 26 Feb 2006 20:39:09 +0000 Subject: 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 --- src/modules/m_spanningtree.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/modules/m_spanningtree.cpp') 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."); } -- cgit v1.2.3