diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2015-07-31 00:54:03 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2015-07-31 00:54:03 +0200 |
commit | 9b56a0d4e79e4d61cbab1dbcc44bc79341d1aa5c (patch) | |
tree | 1b74f19d7298c9626c20bedb0a70dc9d2315ec77 /common | |
parent | e2e42e3b6f2b317f814aff2858a35a0993c94724 (diff) | |
download | sink-9b56a0d4e79e4d61cbab1dbcc44bc79341d1aa5c.tar.gz sink-9b56a0d4e79e4d61cbab1dbcc44bc79341d1aa5c.zip |
Debugmessage for received commands in resource
Diffstat (limited to 'common')
-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); |