diff options
-rw-r--r-- | common/listener.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
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) | |||
291 | const uint messageId = *(uint*)client.commandBuffer.constData(); | 291 | const uint messageId = *(uint*)client.commandBuffer.constData(); |
292 | const int commandId = *(int*)(client.commandBuffer.constData() + sizeof(uint)); | 292 | const int commandId = *(int*)(client.commandBuffer.constData() + sizeof(uint)); |
293 | const uint size = *(uint*)(client.commandBuffer.constData() + sizeof(int) + sizeof(uint)); | 293 | const uint size = *(uint*)(client.commandBuffer.constData() + sizeof(int) + sizeof(uint)); |
294 | Trace() << "Received message. Id:" << messageId << " CommandId: " << commandId << " Size: " << size; | ||
294 | 295 | ||
295 | //TODO: reject messages above a certain size? | 296 | //TODO: reject messages above a certain size? |
296 | 297 | ||
297 | if (size <= uint(client.commandBuffer.size() - headerSize)) { | 298 | const bool commandComplete = size <= uint(client.commandBuffer.size() - headerSize); |
299 | if (commandComplete) { | ||
298 | client.commandBuffer.remove(0, headerSize); | 300 | client.commandBuffer.remove(0, headerSize); |
299 | 301 | ||
300 | auto socket = QPointer<QLocalSocket>(client.socket); | 302 | auto socket = QPointer<QLocalSocket>(client.socket); |