From 9b56a0d4e79e4d61cbab1dbcc44bc79341d1aa5c Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Fri, 31 Jul 2015 00:54:03 +0200 Subject: Debugmessage for received commands in resource --- common/listener.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'common/listener.cpp') diff --git a/common/listener.cpp b/common/listener.cpp index 8532ade..1159252 100644 --- a/common/listener.cpp +++ b/common/listener.cpp @@ -291,10 +291,12 @@ bool Listener::processClientBuffer(Client &client) const uint messageId = *(uint*)client.commandBuffer.constData(); const int commandId = *(int*)(client.commandBuffer.constData() + sizeof(uint)); const uint size = *(uint*)(client.commandBuffer.constData() + sizeof(int) + sizeof(uint)); + Trace() << "Received message. Id:" << messageId << " CommandId: " << commandId << " Size: " << size; //TODO: reject messages above a certain size? - if (size <= uint(client.commandBuffer.size() - headerSize)) { + const bool commandComplete = size <= uint(client.commandBuffer.size() - headerSize); + if (commandComplete) { client.commandBuffer.remove(0, headerSize); auto socket = QPointer(client.socket); -- cgit v1.2.3