mirror of https://github.com/Icinga/icinga2.git
Merge pull request #5524 from Icinga/fix/cluster-fifo-optimize
Change FIFO::Optimize() frequency for large messages
This commit is contained in:
commit
778c742b75
|
@ -67,7 +67,7 @@ void FIFO::ResizeBuffer(size_t newSize, bool decrease)
|
|||
*/
|
||||
void FIFO::Optimize(void)
|
||||
{
|
||||
if (m_Offset - m_DataSize > 1024) {
|
||||
if (m_Offset > m_DataSize / 10 && m_Offset - m_DataSize > 1024) {
|
||||
std::memmove(m_Buffer, m_Buffer + m_Offset, m_DataSize);
|
||||
m_Offset = 0;
|
||||
|
||||
|
|
Loading…
Reference in New Issue