aboutsummaryrefslogtreecommitdiff
path: root/client/Client.cpp
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2022-10-30 11:40:14 +0100
committerlonkaars <loek@pipeframe.xyz>2022-10-30 11:40:14 +0100
commite8b58762643f0a20454068e352738ecffc372c7e (patch)
tree360a2d312fe4bcf12c5aa513f0e47139c754621b /client/Client.cpp
parente4f41ef8b56b76214d05bce34ffd5a8896da24c9 (diff)
fix request send routine
Diffstat (limited to 'client/Client.cpp')
-rw-r--r--client/Client.cpp16
1 files changed, 9 insertions, 7 deletions
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 <stdio.h>
+
#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();