- 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.12 6.8
Change-Id: I7b25e8ac3f83fa262a19010df9a91b2ee1c006fd
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
- 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.12 6.8
Task-number: QTBUG-149570
Change-Id: I06c86414c3297caa386059a02fdec5c3765a0315
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
- 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.12 6.8
Task-number: QTBUG-149564
Change-Id: I252c67966bf28c6994f34b19024d1b7894748473
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
- 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.12 6.8
Task-number: QTBUG-149565
Change-Id: I13d45c24d24fe862d9aec6a7e421f5ef4d494db0
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
- 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 6.12
Task-number: QTBUG-149565
Change-Id: I8f6cc8d6f3011a89d3bd4033a3432f383e1e9164
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
- 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 6.12
Task-number: QTBUG-149571
Change-Id: I78c2063c7e01af3e8f196f824216d31de92fab48
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
- 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.12 6.11
Change-Id: I1695c8ca1af616512dff437a0a4cdbd0491412d4
Reviewed-by: Toni Saario <toni.saario@qt.io>
- 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
Pick-to: 6.12
Task-number: QTBUG-144762
Change-Id: I7b6d53116269007aca7d6f050b2abeb2515e9390
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Point potential contributors to contribute.qt-project.org.
Change-Id: Id4dbc0dda57fe316f5d338dd0ef407b278287671
Reviewed-by: Paul Wicking <paul.wicking@qt.io>