Limit server query space to 8K entries.

In the default configuration this limit is unlikely to be hit. On Windows the
send buffer is 64 KB, which results in ~5K entries. On Linux the buffer is a
bit higher and the number of entries is lower than 7K.
This commit is contained in:
Bartosz Taudul 2021-11-14 18:13:34 +01:00
parent 0e05d70691
commit f2380590f9
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3

View File

@ -3077,7 +3077,7 @@ void Worker::Exec()
} }
} }
m_serverQuerySpaceBase = m_serverQuerySpaceLeft = ( m_sock.GetSendBufSize() / ServerQueryPacketSize ) - ServerQueryPacketSize; // leave space for terminate request m_serverQuerySpaceBase = m_serverQuerySpaceLeft = std::min( ( m_sock.GetSendBufSize() / ServerQueryPacketSize ), 8*1024 ) - 4; // leave space for terminate request
m_hasData.store( true, std::memory_order_release ); m_hasData.store( true, std::memory_order_release );
LZ4_setStreamDecode( (LZ4_streamDecode_t*)m_stream, nullptr, 0 ); LZ4_setStreamDecode( (LZ4_streamDecode_t*)m_stream, nullptr, 0 );