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

1128 Commits

Author SHA1 Message Date
Qt Submodule Update Bot
f74f931ff3 Update dependencies on '6.12.0' in qt/qtmqtt
Change-Id: I2a3ff003ea86f16a44376cea1fbdf591489449d2
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-09-27 10:11:48 +00:00
Qt Submodule Update Bot
ea0d35c51f Update dependencies on '6.12.0' in qt/qtmqtt
Change-Id: Ia0687a6b6b78075ce4bc95d2074f21bcb338b63b
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-09-26 14:50:54 +00:00
Qt Submodule Update Bot
5e6b3a581d Update dependencies on '6.12.0' in qt/qtmqtt
Change-Id: I176c95c27f0cad87e69bf2a49cd12c7a383a1dc8
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-09-25 10:54:56 +00:00
Qt Submodule Update Bot
0ac965b1ce Update dependencies on '6.12.0' in qt/qtmqtt
Change-Id: I44f0d72136167a28385a96ece6adae9155d26686
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-09-24 10:38:18 +00:00
Qt Submodule Update Bot
ecd87f0fa4 Update dependencies on '6.12.0' in qt/qtmqtt
Change-Id: I4dfcd26e03943db65816c2169f5e5f9886f67ddd
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-09-13 20:14:59 +00:00
Qt Submodule Update Bot
5c0165db22 Update dependencies on '6.12.0' in qt/qtmqtt
Change-Id: I8b0e27116fedb575cce43835087a649b437df43f
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-09-13 05:15:37 +00:00
Qt Submodule Update Bot
8eac7aee16 Update dependencies on '6.12.0' in qt/qtmqtt
Change-Id: I2f3593a91f5b81ecc6fbc949535d8a80a56dd00e
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-09-10 12:20:14 +00:00
Qt Submodule Update Bot
8755e56bf9 Update dependencies on '6.12' in qt/qtmqtt
Change-Id: Ifbd8e2688d4ed87c9ea2af0d7670cc234d6a02f4
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-09-08 12:50:15 +00:00
Qt Submodule Update Bot
952deea72f Update dependencies on '6.12' in qt/qtmqtt
Change-Id: I5b14cc2eb2cd829e3e0b718a558d3f3f36f6c6b7
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-09-04 08:56:20 +00:00
Qt Submodule Update Bot
e4bf654fc3 Update dependencies on '6.12' in qt/qtmqtt
Change-Id: Iae439fabb4de7df86a067fa871c13dfa7c57e0a3
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-09-02 00:09:15 +00:00
Tatiana Borisova
c662f644fd 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.11 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>
2026-09-01 19:12:30 +00:00
Tatiana Borisova
88430cff7a 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.11 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>
2026-09-01 17:40:43 +00:00
Tatiana Borisova
eea36a1e4c 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.11 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>
2026-09-01 14:11:33 +00:00
Tatiana Borisova
86544d2644 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.11 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>
2026-08-28 19:34:10 +00:00
Qt Submodule Update Bot
2c201a0051 Update dependencies on '6.12' in qt/qtmqtt
Change-Id: I7b7f0238723c9261bdd834833e21cfd08f9c4df8
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-08-28 17:50:48 +00:00
Tatiana Borisova
f5f164e7b3 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.11 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>
2026-08-28 15:45:13 +00:00
Tatiana Borisova
514890bd67 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.11 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>
2026-08-28 15:45:07 +00:00
Tatiana Borisova
1556fcfaef 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.11 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>
2026-08-28 15:45:01 +00:00
Qt Submodule Update Bot
df4ce2ab95 Update dependencies on '6.12' in qt/qtmqtt
Change-Id: I45bcf6f022522dda60380510749961ab70d5cbd6
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-08-23 01:09:28 +00:00
Tatiana Borisova
ad2e999485 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.

Pick-to: 6.11
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>
2026-08-17 10:49:31 +00:00
Qt Submodule Update Bot
7e21bdc504 Update dependencies on '6.12' in qt/qtmqtt
Change-Id: Id904f0fadef9ecdf9b9eff33e1d4f6188f503563
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-08-17 00:46:52 +00:00
Qt Submodule Update Bot
afa0ae0ebb Update dependencies on '6.12' in qt/qtmqtt
Change-Id: I941f8d0f7f9d40e5cb01cc5ab88d7f2612b26ae9
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-08-13 14:28:13 +00:00
Qt Submodule Update Bot
67795ca92c Update dependencies on '6.12' in qt/qtmqtt
Change-Id: Icdaa8a67f9f23d96469ba5d5d596c7eafed29bda
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-08-07 11:08:45 +00:00
Qt Submodule Update Bot
9a50286b2d Update dependencies on '6.12' in qt/qtmqtt
Change-Id: I8566881c45fb6a000f661faf09e89e3aaf9b5f65
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-08-05 01:07:28 +00:00
Qt Submodule Update Bot
fe8e720a05 Update dependencies on '6.12' in qt/qtmqtt
Change-Id: I7503071497ac4deadd70dfb4e2cbf77bea6ed33c
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-07-31 23:50:45 +00:00
Qt Submodule Update Bot
c57e3d9234 Update dependencies on '6.12' in qt/qtmqtt
Change-Id: Id97145f04bc031f0a8f2b00ef4261d920228ddfe
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-07-29 21:49:59 +00:00
Jani Heikkinen
3b7642ab9b Replace Q_ENUMS with Q_ENUM
Amends ea3dc64d3f,
7467bbdc84, and
ea0d792a44 (all before 6.0).

Fixes: QTBUG-148625
Pick-to: 6.11 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>
2026-07-29 13:13:00 +00:00
Tatiana Borisova
8f5fec801a Fix Qt-RangeLoopDetach Axivion warnings
- use std::as_const() where possible, and introduce an intermediate
  local const variable where it is not.

Axivion-Id: qt_Add-ons_qtmqtt_dev_linux:SV34
Axivion-Id: qt_Add-ons_qtmqtt_dev_linux:SV35
Axivion-Id: qt_Add-ons_qtmqtt_dev_linux:SV36
Axivion-Id: qt_Add-ons_qtmqtt_dev_linux:SV37
Task-number: QTBUG-144762
Change-Id: I7b6d53116269007aca7d6f050b2abeb2515e9390
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 14de26f60b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2026-07-22 12:24:38 +00:00
Qt Submodule Update Bot
c2cbdfe281 Update dependencies on '6.12' in qt/qtmqtt
Change-Id: Id875b4bcc8bc514985d32307cf738cbb5e03fe00
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-07-16 14:31:53 +00:00
Qt Submodule Update Bot
18b1bfb4e6 Update dependencies on '6.12' in qt/qtmqtt
Change-Id: I57791be4a29d41a7c075c303296d519481381c07
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-07-10 00:26:03 +00:00
Qt Submodule Update Bot
a4bb6b3cfd Update dependencies on '6.12' in qt/qtmqtt
Change-Id: I840d961e59bb6a12ec4441eb38f0e9d89c03b1ba
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-07-02 19:29:19 +00:00
Qt Submodule Update Bot
2633144177 Update dependencies on '6.12' in qt/qtmqtt
Change-Id: I65bf496f44bffeb613b4a8c47896b7d21c0793f5
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-06-25 17:42:45 +00:00
Qt Submodule Update Bot
e960ae0be7 Update dependencies on '6.12' in qt/qtmqtt
Change-Id: Ieee79aa6ed902e62b1a9fd4c4adcffa1d5e051d1
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-06-15 10:26:43 +00:00
Qt Submodule Update Bot
7c16df3cfc Update dependencies on '6.12' in qt/qtmqtt
Change-Id: Ic3bbff5de8cdd308edd6950c9232254ce0d0a5ca
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-06-07 07:36:30 +00:00
Qt Submodule Update Bot
8014860ed6 Update dependencies on '6.12' in qt/qtmqtt
Change-Id: I1271625693864022f54e3f3e15e9dbf7ffc9d507
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-06-02 16:46:46 +00:00
Qt Submodule Update Bot
1d7f954339 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I6b6c3fe3edd69ee2444bc7246d1c6916e3f8ba5d
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-06-02 05:06:50 +00:00
Qt Submodule Update Bot
f7267c6452 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Ieff8861b81fe08d9e05eae5343ad6716d7698383
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-05-31 15:44:17 +00:00
Qt Submodule Update Bot
cefbe34e78 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Ieb10ad55da60b7ef62c9d84479fe98f5ea515209
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-05-29 01:11:37 +00:00
Qt Submodule Update Bot
b7d124d65f Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I858f5ccddc5f368659f43646fa005537dce71a87
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-05-25 20:20:43 +00:00
Qt Submodule Update Bot
e7616f09c1 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I77d9159d75ac22b8fff8996dc4e403bc42421563
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-05-22 12:04:27 +00:00
Qt Submodule Update Bot
ba85d5db5c Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I72a5e492509e54a18ee16a953e6a6c222a9aa124
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-05-15 12:13:24 +00:00
Qt Submodule Update Bot
396d0f90e7 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Iefedb03a0bf4aa12a5f13fd36d92a89d5631e685
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-05-08 05:41:49 +00:00
Qt Submodule Update Bot
468dfd5357 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Idcc316e0dea54aeb45941abebab5c4e28a55cd62
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-05-05 14:50:43 +00:00
Marc Mutz
24ec59ffbb Disable 1-to-2-arg qHash() adapter in qtmqtt
Pick-to: 6.11
Task-number: QTBUG-145851
Change-Id: Ic9f6a64b8aa99aad7682e5e6379d304bcff3a7d7
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2026-05-04 10:43:37 +00:00
Qt Submodule Update Bot
c0f5cee7eb Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I421dcdadb5e23c65b453f555a25c3d0f9bba8dd1
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-04-30 13:10:00 +00:00
Kai Köhne
5287cf1442 Add CONTRIBUTING.md file
Point potential contributors to contribute.qt-project.org.

Change-Id: Id4dbc0dda57fe316f5d338dd0ef407b278287671
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2026-04-21 07:22:04 +00:00
Qt Submodule Update Bot
778fa2d33c Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I40d407b8b63b744c47ba731c02e72c66529bb241
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-04-20 19:01:00 +00:00
Qt Submodule Update Bot
92c214f82a Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Ibfb2ad9bb0924abb7a074358c4ba1f877c81c489
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-04-17 18:55:29 +00:00
Qt Submodule Update Bot
ed2aeb5392 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I7483d2540c6338db7b3f8b444cbf05daf07564a8
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-04-16 07:38:06 +00:00
Qt Submodule Update Bot
fe7422c165 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I5dfd827abd2d9fe68403371fd40659ea2e9c459e
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-03-30 09:25:50 +00:00