From 077677134cceb0eaa690f81e5dc08f83b4b31eee Mon Sep 17 00:00:00 2001 From: Klaus Basan Date: Tue, 24 Mar 2020 20:15:55 +0100 Subject: [PATCH] [FSD] Clearer "too many lines" message --- src/blackcore/fsd/fsdclient.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/blackcore/fsd/fsdclient.cpp b/src/blackcore/fsd/fsdclient.cpp index 2825cecc1..effff8624 100644 --- a/src/blackcore/fsd/fsdclient.cpp +++ b/src/blackcore/fsd/fsdclient.cpp @@ -1808,11 +1808,15 @@ namespace BlackCore const QString data = m_fsdTextCodec->toUnicode(dataEncoded); this->parseMessage(data); lines++; - if (lines > 30) + + static constexpr int MaxLines = 50; + if (lines > MaxLines) { - CLogMessage(this).debug(u"ReadDataFromSocket has too many lines"); + static constexpr int DelayMs = 10; + + CLogMessage(this).debug(u"ReadDataFromSocket has too many lines (>%1), will read again in %2ms") << MaxLines << DelayMs; QPointer myself(this); - QTimer::singleShot(10, this, [ = ] + QTimer::singleShot(DelayMs, this, [ = ] { if (myself) { myself->readDataFromSocket(); } });