Add new global setting MaxBufferSize

Previously, /znc setbuffer had a hardcoded limit of 500, other ways of setting
the buffer size didn't have any limit built-in.

This patch makes that limit configurable and makes sure the various places
honour it.

Thanks to DarthGandalf for the idea with the bForce argument, I were too
small-minded to come up with it myself. :(


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2020 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
psychon
2010-06-12 20:20:33 +00:00
parent a8b011fd50
commit e62ca4112d
9 changed files with 52 additions and 22 deletions

View File

@@ -208,8 +208,11 @@ public:
pNewUser->SetVHost(pUser->GetVHost());
}
pNewUser->SetSkinName(WebSock.GetParam("skin"));
// First apply the old limit in case the new one is too high
if (pUser)
pNewUser->SetBufferCount(pUser->GetBufferCount(), true);
pNewUser->SetBufferCount(WebSock.GetParam("bufsize").ToUInt());
pNewUser->SetSkinName(WebSock.GetParam("skin"));
pNewUser->SetKeepBuffer(WebSock.GetParam("keepbuffer").ToBool());
pNewUser->SetMultiClients(WebSock.GetParam("multiclients").ToBool());
pNewUser->SetBounceDCCs(WebSock.GetParam("bouncedccs").ToBool());
@@ -510,8 +513,8 @@ public:
pUser->AddChan(pChan);
}
pChan->SetDefaultModes(WebSock.GetParam("defmodes"));
pChan->SetBufferCount(WebSock.GetParam("buffercount").ToUInt());
pChan->SetDefaultModes(WebSock.GetParam("defmodes"));
pChan->SetInConfig(WebSock.GetParam("save").ToBool());
pChan->SetKeepBuffer(WebSock.GetParam("keepbuffer").ToBool());