diff options
author | Maurice Kalinowski <maurice.kalinowski@qt.io> | 2018-08-02 10:19:06 +0200 |
---|---|---|
committer | Maurice Kalinowski <maurice.kalinowski@qt.io> | 2018-08-02 09:16:00 +0000 |
commit | 3bd1ef6f823b74b39b74c0268fa97a6c057e2ec5 (patch) | |
tree | 4aba3afda6cc3594ab280c43d6e15421e2662963 | |
parent | 4ffc9efc7ba30e0459a6653aac626c01a1f57173 (diff) |
Prefer typed buffer read
Change-Id: I6ed09a09c0ff763b55a358c2a7667cef3174774b
Reviewed-by: hjk <hjk@qt.io>
-rw-r--r-- | src/mqtt/qmqttconnection.cpp | 8 |
1 files 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<quint16>(&propertyLength); - const QByteArray data = readBuffer(dataLength); - propertyLength -= dataLength; + const QByteArray data = readBufferTyped<QByteArray>(&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<quint16>(&propertyLength); - const QByteArray data = readBuffer(length); - propertyLength -= length; + const QByteArray data = readBufferTyped<QByteArray>(&propertyLength); properties.setCorrelationData(data); break; } |