From 000efa6be33b416c91de48310f72285d8e77c985 Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Mon, 28 Mar 2011 21:17:18 +0200 Subject: [PATCH] Don't try connecting users if the ISpoof is locked This fixes various issues with slow connecting users. E.g. the users caused themselves to be added to the ConnectThrottle map even though they didn't actually try to connect. Signed-off-by: Uli Schlachter --- znc.cpp | 5 +++++ znc.h | 1 + 2 files changed, 6 insertions(+) diff --git a/znc.cpp b/znc.cpp index b4e9e56a..0c9782e5 100644 --- a/znc.cpp +++ b/znc.cpp @@ -1989,6 +1989,11 @@ protected: const map& mUsers = CZNC::Get().GetUserMap(); map::const_iterator it = mUsers.begin(); + if (CZNC::Get().IsISpoofLocked()) { + // Meh, gotta retry later + return; + } + uiUserCount = CZNC::Get().GetUserMap().size(); if (m_uiPosNextUser >= uiUserCount) { diff --git a/znc.h b/znc.h index 5b334975..414d4aeb 100644 --- a/znc.h +++ b/znc.h @@ -37,6 +37,7 @@ public: void Loop(); bool WriteISpoof(CUser* pUser); void ReleaseISpoof(); + bool IsISpoofLocked() { return m_pISpoofLockFile != NULL; } bool WritePidFile(int iPid); bool DeletePidFile(); bool WaitForChildLock();