From 7107ec12d8640d35cfe3d5002db1bc1deb33625d Mon Sep 17 00:00:00 2001 From: danieldg Date: Sat, 26 Sep 2009 16:41:07 +0000 Subject: Flexible SendQ git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11766 e03df62e-2008-0410-955e-edbf42e46eb7 --- include/modules.h | 11 +---------- include/users.h | 22 ++++++++++++++++++---- 2 files changed, 19 insertions(+), 14 deletions(-) (limited to 'include') diff --git a/include/modules.h b/include/modules.h index 63492b885..ff52cd600 100644 --- a/include/modules.h +++ b/include/modules.h @@ -388,7 +388,7 @@ enum Implementation I_OnPostTopicChange, I_OnEvent, I_OnRequest, I_OnGlobalOper, I_OnPostConnect, I_OnAddBan, I_OnDelBan, I_OnChangeLocalUserGECOS, I_OnUserRegister, I_OnChannelPreDelete, I_OnChannelDelete, I_OnPostOper, I_OnSyncNetwork, I_OnSetAway, I_OnUserList, I_OnPostCommand, I_OnPostJoin, - I_OnWhoisLine, I_OnBuildExemptList, I_OnGarbageCollect, I_OnBufferFlushed, + I_OnWhoisLine, I_OnBuildExemptList, I_OnGarbageCollect, I_OnText, I_OnPassCompare, I_OnRunTestSuite, I_OnNamesListItem, I_OnNumeric, I_OnHookIO, I_OnHostCycle, I_OnPreRehash, I_OnModuleRehash, I_OnSendWhoLine, I_OnChangeIdent, I_END @@ -1305,15 +1305,6 @@ class CoreExport Module : public Extensible */ virtual void OnGarbageCollect(); - /** Called whenever a user's write buffer has been completely sent. - * This is called when the user's write buffer is completely empty, and - * there are no more pending bytes to be written and no pending write events - * in the socket engine's queue. This may be used to refill the buffer with - * data which is being spooled in a controlled manner, e.g. LIST lines. - * @param user The user who's buffer is now empty. - */ - virtual void OnBufferFlushed(User* user); - /** Add test suite hooks here. These are used for testing functionality of a module * via the --testsuite debugging parameter. */ diff --git a/include/users.h b/include/users.h index 763d45c57..76337b2c3 100644 --- a/include/users.h +++ b/include/users.h @@ -93,8 +93,14 @@ struct CoreExport ConnectClass : public classbase std::string hash; /** Maximum size of sendq for users in this class (bytes) + * Users cannot send commands if they go over this limit */ - unsigned long sendqmax; + unsigned long softsendqmax; + + /** Maximum size of sendq for users in this class (bytes) + * Users are killed if they go over this limit + */ + unsigned long hardsendqmax; /** Maximum size of recvq for users in this class (bytes) */ @@ -157,11 +163,19 @@ struct CoreExport ConnectClass : public classbase return (pingtime ? pingtime : 120); } - /** Returns the maximum sendq value + /** Returns the maximum sendq value (soft limit) + * Note that this is in addition to internal OS buffers + */ + unsigned long GetSendqSoftMax() + { + return (softsendqmax ? softsendqmax : 4096); + } + + /** Returns the maximum sendq value (hard limit) */ - unsigned long GetSendqMax() + unsigned long GetSendqHardMax() { - return (sendqmax ? sendqmax : 262114); + return (hardsendqmax ? hardsendqmax : 0x100000); } /** Returns the maximum recvq value -- cgit v1.2.3