summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaurice Kalinowski <maurice.kalinowski@qt.io>2018-08-10 12:41:04 +0200
committerMaurice Kalinowski <maurice.kalinowski@qt.io>2018-08-10 10:55:02 +0000
commit2fea72c75148459a5caa8aed08dadeabdcb0887e (patch)
tree2642abe22595a7ff72da3ee0ddc5a101b5355512
parente6baf4b075b682a963f367ce8f196a6798b5ca28 (diff)
Fix subscription for retained messages
readVariableByteInteger returns the amount of bytes to come, not the bytes read to receive this value. Change-Id: I02b55622f2f668dcc582556087bb2fd78b53957d Reviewed-by: hjk <hjk@qt.io>
-rw-r--r--src/mqtt/qmqttconnection.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mqtt/qmqttconnection.cpp b/src/mqtt/qmqttconnection.cpp
index 7092249..69e153b 100644
--- a/src/mqtt/qmqttconnection.cpp
+++ b/src/mqtt/qmqttconnection.cpp
@@ -965,9 +965,10 @@ void QMqttConnection::readPublishProperties(QMqttPublishProperties &properties)
void QMqttConnection::readSubscriptionProperties(QMqttSubscription *sub)
{
- qint64 propertyLength = readVariableByteInteger();
+ qint32 bytes = 0;
+ qint64 propertyLength = readVariableByteInteger(&bytes);
- m_missingData -= propertyLength;
+ m_missingData -= bytes;
while (propertyLength > 0) {
const quint8 propertyId = readBufferTyped<quint8>(&propertyLength);
switch (propertyId) {