mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-27 02:55:44 +08:00
[FSD] Clearer "too many lines" message
This commit is contained in:
committed by
Mat Sutcliffe
parent
21068427b0
commit
077677134c
@@ -1808,11 +1808,15 @@ namespace BlackCore
|
|||||||
const QString data = m_fsdTextCodec->toUnicode(dataEncoded);
|
const QString data = m_fsdTextCodec->toUnicode(dataEncoded);
|
||||||
this->parseMessage(data);
|
this->parseMessage(data);
|
||||||
lines++;
|
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<CFSDClient> myself(this);
|
QPointer<CFSDClient> myself(this);
|
||||||
QTimer::singleShot(10, this, [ = ]
|
QTimer::singleShot(DelayMs, this, [ = ]
|
||||||
{
|
{
|
||||||
if (myself) { myself->readDataFromSocket(); }
|
if (myself) { myself->readDataFromSocket(); }
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user