From 3bd1ef6f823b74b39b74c0268fa97a6c057e2ec5 Mon Sep 17 00:00:00 2001 From: Maurice Kalinowski Date: Thu, 2 Aug 2018 10:19:06 +0200 Subject: Prefer typed buffer read Change-Id: I6ed09a09c0ff763b55a358c2a7667cef3174774b Reviewed-by: hjk --- src/mqtt/qmqttconnection.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/mqtt/qmqttconnection.cpp b/src/mqtt/qmqttconnection.cpp index 9d58959..0af25ae 100644 --- a/src/mqtt/qmqttconnection.cpp +++ b/src/mqtt/qmqttconnection.cpp @@ -837,9 +837,7 @@ void QMqttConnection::readConnackProperties() break; } case 0x16: { // 3.2.2.3.18 Authentication data - const quint16 dataLength = readBufferTyped(&propertyLength); - const QByteArray data = readBuffer(dataLength); - propertyLength -= dataLength; + const QByteArray data = readBufferTyped(&propertyLength); serverProperties.serverData->details |= QMqttServerConnectionProperties::AuthenticationData; serverProperties.data->authenticationData = data; break; @@ -886,9 +884,7 @@ void QMqttConnection::readPublishProperties(QMqttPublishProperties &properties) break; } case 0x09: { // 3.3.2.3.6 Correlation Data - const quint16 length = readBufferTyped(&propertyLength); - const QByteArray data = readBuffer(length); - propertyLength -= length; + const QByteArray data = readBufferTyped(&propertyLength); properties.setCorrelationData(data); break; } -- cgit v1.2.3