1
0
mirror of https://github.com/qt/qtmqtt.git synced 2026-10-25 16:16:26 +00:00
Commit Graph

1135 Commits

Author SHA1 Message Date
Qt Submodule Update Bot
db8d6dae58 Update dependencies on '6.11.3' in qt/qtmqtt
Change-Id: Ic5ba08477d8e682da254afb5c67b6d00b75d9a8e
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-10-20 23:48:43 +00:00
Qt Submodule Update Bot
32ce87bdfc Update dependencies on '6.11.3' in qt/qtmqtt
Change-Id: I0a5a1dfc7002f914c4413c9e244d97cce709e9ff
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-10-03 17:38:48 +00:00
Qt Submodule Update Bot
161436cddf Update dependencies on '6.11.3' in qt/qtmqtt
Change-Id: I5620a7e29ad8ca650cd6316db2187a3eb0d1bb24
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-09-23 03:35:39 +00:00
Qt Submodule Update Bot
2db6caea37 Update dependencies on '6.11.3' in qt/qtmqtt
Change-Id: I2842e40a07445e7da961813ad405962dd44cf2ae
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-09-22 07:40:23 +00:00
Qt Submodule Update Bot
10ae43e263 Update dependencies on '6.11.3' in qt/qtmqtt
Change-Id: I27ccfb56c279ae64e39cae9eb89c34cef6b7e258
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-09-21 08:32:25 +00:00
Qt Submodule Update Bot
2759345be8 Update dependencies on '6.11' in qt/qtmqtt
Change-Id: I08ae3dd15250ae331eb666e9964a57858d3ef409
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-09-09 11:45:44 +00:00
Qt Submodule Update Bot
c8e46214ad Update dependencies on '6.11' in qt/qtmqtt
Change-Id: I845dd06a6d8d8bb26bb529783d66883b56d50e92
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-09-04 12:00:47 +00:00
Tatiana Borisova
cd0265b890 Read the Remaining Length as a variable byte integer everywhere
- Every MQTT packet begins with a fixed header, whose second field is the
Remaining Length: the number of bytes that follow. It is not a byte. It
is spread over one to four bytes, seven value bits each, with the top
bit meaning "another byte follows". So values up to 127 take one byte,
and larger values take more.

Six packet types read it as a single quint8: SUBACK, UNSUBACK, PUBACK,
PUBREC, PUBREL and PUBCOMP. For most of them that used to be correct.
In MQTT 3.1.1 those packets contain nothing but a two byte identifier,
so the length was always exactly 2, which always fits in one byte. The
code did not even use the byte it read: it checked that the value was 2
and then hardcoded the length.

MQTT 5.0 support (ac66658) gave those packets an optional reason code
and properties, so the length can now be far above 127. That commit
switched off the "must be 2" check for MQTT 5.0 and began using the
byte as the real length, but kept reading only one byte. The check had
been the only thing making a one byte read safe, because a multi-byte
length always has its top bit set and so could never equal 2.

SUBACK never had a fixed length at all, since its payload carries one
reason code per subscribed topic filter. It has been misparsed for any
SUBACK above 127 bytes since the parser was written (d96011b).

Reading one byte of a two byte length consumes one byte too few, so the
remainder of the packet is then read as the next packet's header. The
client rejects a valid acknowledgement and stays out of step for the
rest of the connection. Brokers trigger this on ordinary traffic as
soon as they attach a reason string or user properties.

All six now use readVariableByteInteger(), and each rejects a length too
short to hold the fields the specification requires.

PUBREL also accepted a length of exactly 2 even for MQTT 5.0, which
rejected valid PUBREL packets carrying a reason code. It now accepts 2
or more there, and still requires exactly 2 for MQTT 3.1.1.

- Adds three regression tests driving the parser through the existing
FakeServer, so they need no broker.

Pick-to: 6.8
Task-number: QTBUG-149569
Change-Id: Ib239d836556e0cc14e13c116dee757fdd1a7ae81
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 06d301aa50)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit c662f644fd)
2026-09-01 20:18:47 +00:00
Tatiana Borisova
5b5aa01569 PINGRESP from the network should not push the counter below zero
- finalize_pingresp() lowers m_pingTimeout every time, with no lower
limit. A broker can send a pile of unasked-for replies to push the
counter deep below zero, and then the client can spend some unexpected
amount of time to reach back the number that means:
"the broker has stopped answering, drop the link.”
- The fix prohibits pushing the counter below zero.

Task-number: QTBUG-149662
Pick-to: 6.8
Change-Id: I7b25e8ac3f83fa262a19010df9a91b2ee1c006fd
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 33538c5143)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 88430cff7a)
2026-09-01 19:12:35 +00:00
Tatiana Borisova
e5185f5eab Skip remaining data for messages with unknown requests
- finalize_suback() and finalize_unsuback() read the 2-byte request ID.
If no matching request was found, they returned immediately.
However, m_missingData remained non-zero.
The leftover bytes are then incorrectly interpreted as the header of
the next message!

- This change fixes the issue universally for all handlers in the
processDataHelper().

Pick-to: 6.8
Task-number: QTBUG-149570
Change-Id: I06c86414c3297caa386059a02fdec5c3765a0315
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 9e0428b917)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit eea36a1e4c)
2026-09-01 16:12:01 +00:00
Qt Submodule Update Bot
ad0d2402ee Update dependencies on '6.11' in qt/qtmqtt
Change-Id: Ic57bc017cbb0f3b68484745686b0fd710e5ee630
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-09-01 08:13:15 +00:00
Qt Submodule Update Bot
f2a493c46d Update dependencies on '6.11' in qt/qtmqtt
Change-Id: I599ff9dc4c6a6c6d4581c5920c96e9686db90022
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-08-31 10:48:27 +00:00
Tatiana Borisova
1b62f5e3b5 Fix topic alias bounds and storage sizes
- In the f8ecf4d56a we found that the
m_receiveAliases bounds check used a wrong property:
m_clientPrivate->m_serverConnectionProperties.maximumTopicAlias(),
but it must use instead:
m_clientPrivate->m_connectionProperties.maximumTopicAlias().

So, the idea is m_receiveAliases is sized according to the maximum
topic alias value declared by the client in CONNECT, while
m_publishAliases is sized according to the maximum value declared
by the server in CONNACK.

The previous fix did not update all related code.
1) The resize() calls for m_receiveAliases and m_publishAliases
still used the wrong properties.
2) The bounds check for m_publishAliases still used the client's
maximumTopicAlias() value instead of the server's.

- Update the resize() calls to use the appropriate connection
properties and fix the bounds check for m_publishAliases.

Amends f8ecf4d56a

Pick-to: 6.8
Task-number: QTBUG-149564
Change-Id: I252c67966bf28c6994f34b19024d1b7894748473
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 011eb1e424)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 86544d2644)
2026-08-28 20:48:30 +00:00
Tatiana Borisova
ec91ec4f64 Stop parsing after closeConnection()
- Parsing continued after closeConnection(), leaving the client in the
"connected" state with a dead socket. This led to a permanent,
unrecoverable wedge in Release builds and a crash in Debug builds.

- Check whether the client is already disconnected before changing its
state to BrokerConnected.

Pick-to: 6.8
Task-number: QTBUG-149565
Change-Id: I13d45c24d24fe862d9aec6a7e421f5ef4d494db0
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit c94175ff43)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit f5f164e7b3)
2026-08-28 17:15:46 +00:00
Tatiana Borisova
84db57140f Check readVariableByteInteger() return value
- On error, readVariableByteInteger() closes the connection and
returns-1. In this case, message handling should stop.

- Add checks for the return value to stop processing when -1 is returned.

Pick-to: 6.8
Task-number: QTBUG-149565
Change-Id: I8f6cc8d6f3011a89d3bd4033a3432f383e1e9164
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 13288574c1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 514890bd67)
2026-08-28 17:15:40 +00:00
Tatiana Borisova
0c32814e88 Number overflow while rejecting a too-long length
- The length reader checked its 4-byte limit after doing the maths.
So, a 5th byte was multiplied in and overflows before the value
was thrown away. But it was not noticed, because we thrown it away
and returned -1.

- The fix moves iteration++ and if (iteration > 4) before the
calculation, preventing the overflow.

Pick-to: 6.8
Task-number: QTBUG-149571
Change-Id: I78c2063c7e01af3e8f196f824216d31de92fab48
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit ecaf42152e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 1556fcfaef)
2026-08-28 17:15:34 +00:00
Qt Submodule Update Bot
a70d7a12cc Update dependencies on '6.11' in qt/qtmqtt
Change-Id: If4e29e0563d769b049629d8113e377fd6f679608
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-08-28 09:21:00 +00:00
Qt Submodule Update Bot
5340fd8096 Update dependencies on '6.11' in qt/qtmqtt
Change-Id: I96993d3d58ed4843faebac143d6523751b600d4c
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-08-27 09:42:37 +00:00
Qt Submodule Update Bot
fab1387f06 Update dependencies on '6.11' in qt/qtmqtt
Change-Id: Id40c1d5ba1f1df3dfc97376b8818a3c1a5edf01a
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-08-25 21:56:53 +00:00
Qt Submodule Update Bot
92de8c94e4 Update dependencies on '6.11' in qt/qtmqtt
Change-Id: Ic21c90633bfa9910c87b613fb1b5737b6d95944f
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-08-24 09:07:33 +00:00
Qt Submodule Update Bot
3ef5009846 Update dependencies on '6.11' in qt/qtmqtt
Change-Id: Ia4c81c9e4b37affe99a6b968db922c6109fe7d6e
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-08-21 13:47:54 +00:00
Qt Submodule Update Bot
3f5e183947 Update dependencies on '6.11' in qt/qtmqtt
Change-Id: Icc20396300e3590afa3270021ba01a5574581598
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-08-20 09:17:44 +00:00
Qt Submodule Update Bot
55d326d5b0 Update dependencies on '6.11' in qt/qtmqtt
Change-Id: I2617fb2eeafe9faf8f2a40746952980d96b88393
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-08-19 11:35:43 +00:00
Qt Submodule Update Bot
b256d5d579 Update dependencies on '6.11' in qt/qtmqtt
Change-Id: I7ac8428e241d997b48f4aedc91c12926c6e1a6a0
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-08-18 09:48:08 +00:00
Tatiana Borisova
933ff3bfce Update to coin_module_test_template_v3.yaml
- The main differences between v2 and v3 are:
  * `coin_module_test_template_v2.yaml` ignores autotest return
    codes because the `COIN_CTEST_IGNORE_EXIT_CODE` flag is set.
  * The Axivion build was moved from coin_module_build_template_v2.yaml
    to coin_module_test_template_v3.yaml in commit
    c3ddec2f15a1cf806d8df444952cb2c2231ae4ad
- Switch the qtmqtt submodule to the newer v3 version to improve
the submodule CI experience for autotests and restore Axivion
checks.

Change-Id: I1695c8ca1af616512dff437a0a4cdbd0491412d4
Reviewed-by: Toni Saario <toni.saario@qt.io>
(cherry picked from commit 96d602b65f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit ad2e999485)
2026-08-17 12:02:57 +00:00
Qt Submodule Update Bot
8695c3f603 Update dependencies on '6.11' in qt/qtmqtt
Change-Id: Ia31e2c685d4dd1d8e86eb016a6c84c39cff0c5bf
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-08-17 08:55:05 +00:00
Qt Submodule Update Bot
a689727a17 Update dependencies on '6.11' in qt/qtmqtt
Change-Id: I4ccff6cd5ca3d95a0e7bea54d07fc099393e2634
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-08-14 16:09:43 +00:00
Jani Heikkinen
67795d7e8e Bump version to 6.11.3
Change-Id: I5ca9c85e24c04cfa97339ed3a898529a25192027
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-08-12 11:44:16 +00:00
Qt Submodule Update Bot
bfde2b57ea Update dependencies on '6.11' in qt/qtmqtt
Change-Id: I43074fae785feea051df7693bea2d62306030608
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-08-12 11:44:15 +00:00
Qt Submodule Update Bot
3413bb88f2 Update dependencies on '6.11' in qt/qtmqtt
Change-Id: Ia177e36a044e139dd277539b5b1034c1447648ed
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-08-04 09:02:13 +00:00
Qt Submodule Update Bot
9ed91b8442 Update dependencies on '6.11' in qt/qtmqtt
Change-Id: I9c5e64e5dc54c3dc3f07bd412285c4f6f0dd8f21
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-07-31 17:52:16 +00:00
Jani Heikkinen
b0e342cbb6 Replace Q_ENUMS with Q_ENUM
Amends ea3dc64d3f,
7467bbdc84, and
ea0d792a44 (all before 6.0).

Fixes: QTBUG-148625
Pick-to: 6.8
Change-Id: I2f9b24f7e32d437cce258dfdce0d669c8d2638e1
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit ebd3d87293)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 3b7642ab9b)
2026-07-29 14:14:51 +00:00
Qt Submodule Update Bot
5e436e7cb7 Update dependencies on '6.11' in qt/qtmqtt
Change-Id: Ie2c13b59a08c7baaacc85a84d598862650e8e241
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-07-28 10:08:44 +00:00
Qt Submodule Update Bot
1be2b6c8bb Update dependencies on '6.11' in qt/qtmqtt
Change-Id: Id13b608c093a6348e8dc8a019e5b46025449b7ab
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-07-24 08:52:40 +00:00
Qt Submodule Update Bot
0302f57f79 Update dependencies on '6.11' in qt/qtmqtt
Change-Id: I247bb1bb3c2a62bd7da03db3263310f3e1a5e192
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-07-14 08:29:33 +00:00
Qt Submodule Update Bot
c76bd5bb78 Update dependencies on '6.11' in qt/qtmqtt
Change-Id: Ia9d6419ab5bd288b5a5a63b34ac2584ad981128a
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-05-27 09:19:06 +00:00
Qt Submodule Update Bot
a01f668f2c Update dependencies on '6.11' in qt/qtmqtt
Change-Id: I98f0c2940e23db1b16329704a181d552102281aa
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-05-22 16:48:37 +00:00
Qt Submodule Update Bot
ab8335dc2d Update dependencies on '6.11' in qt/qtmqtt
Change-Id: I2e91ea6e76d07aea4f945d2e868b8cb956691a50
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-05-20 11:27:24 +00:00
Qt Submodule Update Bot
e5e27908e1 Update dependencies on '6.11' in qt/qtmqtt
Change-Id: I5f6f1c48276da3a63dbaa5d1019aef70198ba2c9
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-05-19 12:10:31 +00:00
Qt Submodule Update Bot
7b9058546f Update dependencies on '6.11' in qt/qtmqtt
Change-Id: Ib9b36cfc1f3df51439d86a99ae4d077c5a82efed
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-05-08 08:45:07 +00:00
Marc Mutz
a0c0d77321 Disable 1-to-2-arg qHash() adapter in qtmqtt
Task-number: QTBUG-145851
Change-Id: Ic9f6a64b8aa99aad7682e5e6379d304bcff3a7d7
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 24ec59ffbb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2026-05-04 13:51:41 +00:00
Qt Submodule Update Bot
605560d39a Update dependencies on '6.11' in qt/qtmqtt
Change-Id: I062356ad8aac8238b5a89af0354963feb8799897
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-04-30 11:39:29 +00:00
Qt Submodule Update Bot
573a27b958 Update dependencies on '6.11' in qt/qtmqtt
Change-Id: I23f87612132ba59055f17930cb7e3ea82114cfbb
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-04-28 20:05:50 +00:00
Jani Heikkinen
860e9892c3 Bump version to 6.11.2
Change-Id: I0b6f2eb3a3e240d6ae8e479662bd140ad306396b
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-04-28 20:05:48 +00:00
Qt Submodule Update Bot
f48e1e7b0c Update dependencies on '6.11' in qt/qtmqtt
Change-Id: I0d6ae0f3f718cc67389bbd5ef6d97f0672a283be
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-04-24 02:47:03 +00:00
Qt Submodule Update Bot
287c1564e3 Update dependencies on '6.11' in qt/qtmqtt
Change-Id: I532cecee18a9090984ebe74a4e112a8bd2279a3e
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-04-23 09:11:42 +00:00
Qt Submodule Update Bot
0cab6640a1 Update dependencies on '6.11' in qt/qtmqtt
Change-Id: I8eeedd84cd8d66082c059c34dd3081cb55cc86ea
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-04-17 19:51:00 +00:00
Qt Submodule Update Bot
e741077526 Update dependencies on '6.11' in qt/qtmqtt
Change-Id: I4a12fcc5e891d805d2fb56fcade7ac3a537ba157
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-04-14 17:38:10 +00:00
Qt Submodule Update Bot
36891f6961 Update dependencies on '6.11' in qt/qtmqtt
Change-Id: Ie5706ca591e42c90775ba5dcb0b2fdc2742a50ca
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-04-08 15:32:31 +00:00
Qt Submodule Update Bot
0ec3c81443 Update dependencies on '6.11' in qt/qtmqtt
Change-Id: Ia01e92f8008e66c5b5207f6abeb625aa02897147
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-04-01 08:05:18 +00:00