From 934d9a6a184b7a8600fcda30e012ba6f29f17b64 Mon Sep 17 00:00:00 2001 From: danieldg Date: Sun, 27 Sep 2009 00:22:29 +0000 Subject: SendQ bugfixes Fix DoWrite running on errored sockets Add testnet module for sendq and shutdown testing Prevent DoWrite from trying to write when writes are blocking git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11768 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/users.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/users.cpp') diff --git a/src/users.cpp b/src/users.cpp index 1f38dfada..fb36ac324 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -575,13 +575,12 @@ void User::AddWriteBuf(const std::string &data) if (!quitting && MyClass && getSendQSize() + data.length() > MyClass->GetSendqHardMax() && !HasPrivPermission("users/flood/increased-buffers")) { /* - * Fix by brain - Set the error text BEFORE calling, because - * if we dont it'll recursively call here over and over again trying - * to repeatedly add the text to the sendq! + * Quit the user FIRST, because otherwise we could recurse + * here and hit the same limit. */ ServerInstance->Users->QuitUser(this, "SendQ exceeded"); - ServerInstance->SNO->WriteToSnoMask('a', "User %s SendQ of %lu exceeds connect class maximum of %lu", - nick.c_str(), (unsigned long)getSendQSize() + data.length(), MyClass->GetSendqHardMax()); + ServerInstance->SNO->WriteToSnoMask('a', "User %s SendQ exceeds connect class maximum of %lu", + nick.c_str(), MyClass->GetSendqHardMax()); return; } -- cgit v1.3.1-10-gc9f91