From 2cd906702d67862591d5ba57a3da16ec22177b1d Mon Sep 17 00:00:00 2001 From: w00t Date: Tue, 15 Jan 2008 15:32:22 +0000 Subject: CullList: Don't try quit everyone. Speed/resource use enhancement on netsplits.. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8711 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/cull_list.cpp | 4 +++- src/inspircd.cpp | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/cull_list.cpp b/src/cull_list.cpp index 594df946c..66fd9f2d9 100644 --- a/src/cull_list.cpp +++ b/src/cull_list.cpp @@ -107,7 +107,9 @@ void CullList::MakeSilent(User* user) int CullList::Apply() { int n = list.size(); - while (list.size()) + int i = 0; + + while (list.size() && i++ != 100) { std::vector::iterator a = list.begin(); diff --git a/src/inspircd.cpp b/src/inspircd.cpp index 4ca4c50d6..8b56706dd 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -625,6 +625,9 @@ int InspIRCd::Run() */ if (TIME != OLDTIME) { + /* if any users were quit, take them out */ + this->GlobalCulls.Apply(); + if (TIME < OLDTIME) { WriteOpers("*** \002EH?!\002 -- Time is flowing BACKWARDS in this dimension! Clock drifted backwards %d secs.",abs(OLDTIME-TIME)); @@ -674,9 +677,6 @@ int InspIRCd::Run() */ this->SE->DispatchEvents(); - /* if any users was quit, take them out */ - this->GlobalCulls.Apply(); - /* If any inspsockets closed, remove them */ this->BufferedSocketCull(); -- cgit v1.2.3