From 1e6aedf9e6d85d5d59324ce404df22984978ebc0 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sat, 22 May 2021 01:05:06 +0200 Subject: [PATCH] Limit client query response rate. Original idea by xavier --- client/TracyProfiler.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/client/TracyProfiler.cpp b/client/TracyProfiler.cpp index 9024c2d7..5aba68ca 100644 --- a/client/TracyProfiler.cpp +++ b/client/TracyProfiler.cpp @@ -1687,10 +1687,12 @@ void Profiler::Worker() keepAlive = 0; } + int quota = 500; bool connActive = true; - while( m_sock->HasData() && connActive ) + while( quota-- && m_sock->HasData() ) { connActive = HandleServerQuery(); + if( !connActive ) break; } if( !connActive ) break; }