Limit client query response rate.

Original idea by xavier <xavierb@gmail.com>
This commit is contained in:
Bartosz Taudul 2021-05-22 01:05:06 +02:00
parent 621d1b03cd
commit 1e6aedf9e6
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3

View File

@ -1687,10 +1687,12 @@ void Profiler::Worker()
keepAlive = 0; keepAlive = 0;
} }
int quota = 500;
bool connActive = true; bool connActive = true;
while( m_sock->HasData() && connActive ) while( quota-- && m_sock->HasData() )
{ {
connActive = HandleServerQuery(); connActive = HandleServerQuery();
if( !connActive ) break;
} }
if( !connActive ) break; if( !connActive ) break;
} }