mirror of
https://github.com/znc/znc.git
synced 2026-03-28 17:42:41 +01:00
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:
@@ -927,14 +927,12 @@ void CClient::UserCommand(CString& sLine) {
|
||||
|
||||
unsigned int uLineCount = sLine.Token(2).ToUInt();
|
||||
|
||||
if (uLineCount > 500) {
|
||||
PutStatus("Max linecount is 500.");
|
||||
return;
|
||||
if (pChan->SetBufferCount(uLineCount)) {
|
||||
PutStatus("BufferCount for [" + sChan + "] set to [" + CString(pChan->GetBufferCount()) + "]");
|
||||
} else {
|
||||
PutStatus("Setting the buffer count failed, max buffer count is "
|
||||
+ CString(CZNC::Get().GetMaxBufferSize()));
|
||||
}
|
||||
|
||||
pChan->SetBufferCount(uLineCount);
|
||||
|
||||
PutStatus("BufferCount for [" + sChan + "] set to [" + CString(pChan->GetBufferCount()) + "]");
|
||||
} else if (m_pUser->IsAdmin() && sCommand.Equals("TRAFFIC")) {
|
||||
CZNC::TrafficStatsPair Users, ZNC, Total;
|
||||
CZNC::TrafficStatsMap traffic = CZNC::Get().GetTrafficStats(Users, ZNC, Total);
|
||||
|
||||
Reference in New Issue
Block a user