mirror of
https://github.com/qt/qtmqtt.git
synced 2026-10-25 16:16:26 +00:00
- 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 ( |
||
|---|---|---|
| .. | ||
| auto | ||
| benchmarks | ||
| certificate | ||
| common | ||
| libfuzzer/mqtt/data_receive | ||
| manual | ||
| CMakeLists.txt | ||
| README.txt | ||
The tests included in the subdirectories check for functionality and conformance of the Qt MQTT module. To be able to run the tests successfully, a broker needs to be available and reachable. The continuous integration utilized the paho conformance test broker. It can be obtained at this location: https://github.com/eclipse/paho.mqtt.testing For the unit tests being able to locate this script, use the MQTT_TEST_BROKER_LOCATION environment variable and set it to “<install-path>/interoperability/startbroker.py”. Alternatively, any broker can be instantiated and passed to the auto tests by using the environment variable MQTT_TEST_BROKER. This must point to a valid url. The broker must run on the standardized port 1883. Note, that the unit tests verify functionality against the MQTT 3.1.1 version of the standard, hence the broker needs to be compliant to the adherent specifications.