mirror of
https://github.com/znc/znc.git
synced 2026-08-06 17:03:14 +02:00
CBuffer: If the allowed buffer size is lowered, shrink the buffer
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1371 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
@@ -74,3 +74,12 @@ bool CBuffer::GetNextLine(const CString& sTarget, CString& sRet) {
|
||||
erase(begin());
|
||||
return true;
|
||||
}
|
||||
|
||||
void CBuffer::SetLineCount(unsigned int u) {
|
||||
m_uLineCount = u;
|
||||
|
||||
// We may need to shrink the buffer if the allowed size got smaller
|
||||
while (size() > m_uLineCount) {
|
||||
erase(begin());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user