From e8b58762643f0a20454068e352738ecffc372c7e Mon Sep 17 00:00:00 2001 From: lonkaars Date: Sun, 30 Oct 2022 11:40:14 +0100 Subject: fix request send routine --- client/Client.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'client/Client.cpp') diff --git a/client/Client.cpp b/client/Client.cpp index 10d288e..4d948fa 100644 --- a/client/Client.cpp +++ b/client/Client.cpp @@ -1,5 +1,8 @@ +#include + #include "Client.h" #include "consts.h" +#include "../shared/util.h" Client::Client(QObject *parent) : QObject(parent) @@ -34,13 +37,12 @@ void Client::ClientEcho() void Client::timeFunction() { - if(_missingRecords>1){ - totalRecords = _missingRecords; - } - else{ - totalRecords=1; - } - QByteArray msgToSend= (msg.toUtf8() + totalRecords + offsetRecords +'\n'); + totalRecords = WS_MAX(1, _missingRecords); + + char* msg = NULL; + asprintf(&msg, "last-records %x %x\n", totalRecords, offsetRecords); + QByteArray msgToSend = msg; + free(msg); QTime time = QTime::currentTime(); qint16 currentSeconds = time.second(); -- cgit v1.2.3