Commit 77c1a815 authored by Axel Auweter's avatar Axel Auweter
Browse files

Fixed a bug in the SimpleMQTTServer that would lead to message corruption when...

Fixed a bug in the SimpleMQTTServer that would lead to message corruption when a message is being decoded from multiple read()s.
parent 44347649
......@@ -133,7 +133,7 @@ ssize_t SimpleMQTTMessage::receiveMessage(void* buf, size_t len)
if (bytesProcessed+len >= remainingLength) {
memcpy(writePtr, buf, remainingLength-bytesProcessed);
lbytes -= remainingLength;
lbytes -= remainingLength-bytesProcessed;
bytesProcessed += remainingLength-bytesProcessed;
/*
......@@ -181,7 +181,7 @@ ssize_t SimpleMQTTMessage::appendRawData(void* buf, size_t len)
lbytes -= bytes;
}
#if 0
#ifdef SimpleMQTTVerbose
coutMtx.lock();
cout << "Finished appendRawData() function. Results follow...\n";
coutMtx.unlock();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment