Details
Description
Right now, QMqttConnection contains code like this (2 locations):
{{m_clientPrivate->m_willMessage.isEmpty() }}
I might be misinterpreting the spec, but:
http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html
3.1.3.3 Will Message
The Will Message defines the Application Message that is to be published to the Will Topic as described in Section 3.1.2.5. This field consists of a two byte length followed by the payload for the Will Message expressed as a sequence of zero or more bytes.
3.3.3 Payload
It is valid for a PUBLISH Packet to contain a zero length payload.
I think both a regular message as well as a will message can be of zero length, i.e. 'empty'.
Right now, the code ignores empty will messages, these are not send/registered.
The usecase for an empty will message is clearing an earlier set retained message, since clearing a retained message is done by posting an empty one.
Attachments
For Gerrit Dashboard: QTBUG-76783 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
266647,4 | Allow empty will messages | 5.12 | qt/qtmqtt | Status: MERGED | +2 | 0 |