mirror of
https://github.com/qt/qtmqtt.git
synced 2026-10-25 16:16:26 +00:00
using client IDs actually works with 3.1
This commit is contained in:
parent
a7b83d7d94
commit
9d9c92f91d
@ -139,18 +139,13 @@ bool QMqttConnection::sendControlConnect()
|
||||
|
||||
// 3.1.3 Payload
|
||||
// 3.1.3.1 Client Identifier
|
||||
if (protocolVersion == 3) { // no username
|
||||
// Client id maximum left is 23
|
||||
const QByteArray clientStringArray = m_client->clientId().left(23).toUtf8();
|
||||
if (clientStringArray.size()) {
|
||||
packet.append(clientStringArray);
|
||||
} else {
|
||||
packet.append(char(0));
|
||||
packet.append(char(0));
|
||||
} else if (protocolVersion == 4) {
|
||||
// Client id maximum left is 23
|
||||
const QByteArray clientStringArray = m_client->clientId().left(23).toUtf8();
|
||||
if (clientStringArray.size()) {
|
||||
packet.append(clientStringArray);
|
||||
} else {
|
||||
packet.append(char(0));
|
||||
packet.append(char(0));
|
||||
}
|
||||
}
|
||||
|
||||
if (!writePacketToTransport(packet)) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user