The QMqtt namespace was missing from the TOC as the .qhp subproject
selected only classes and headers.
Pick-to: 6.12
Change-Id: I5692ae2e77b80d9b3c4361945891e84c1ef4ccf7
Reviewed-by: Alexei Cazacov <alexei.cazacov@qt.io>
- The readBufferTyped<T>() method returns T{0} when it fails. But
in QtMqtt the value 0 is also used as "Success" return code.
In particular, src/mqtt/qmqttconnection.cpp
=> readBufferTyped<T>() returns 0 on failure, and finalize_connack()
reads the login result with it. src/mqtt/qmqttglobal.h =>
QMqtt::ReasonCode defines Success = 0.
So our failure value and the protocol's success value are the same
number.
- To fix this problem I make readBufferTyped<>() return std::nullopt
when the read fails, while using the returned value to represent
uccessfully read data. This allows callers to distinguish read errors
from valid zero values.
[ChangeLog][QMqttConnection][Important Behavior Changes] The Qt MQTT
client now stops parsing and closes the connection with the
ProtocolViolation error when a read error occurs while
parsing a packet.
Task-number: QTBUG-149867
Change-Id: I829a34cecfcb49ba330d5eb65aba755eee9326b0
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
- Enforce the configured packet size limit locally for MQTT 3.1/3.1.1.
- Close the connection if the broker sends a packet exceeding the limit.
MQTT 3.1 and 3.1.1 have no way to tell the broker the maximum packet
size the client accepts, so the limit can only be applied on the
client side. This is helpful for clients on embedded devices, where
memory is limited and a very large packet from the broker could
exhaust it.
[ChangeLog][QMqttClient] The maximumPacketSize connection property is
now also enforced for MQTT 3.1 and 3.1.1 connections. Previously it was
only honored for MQTT 5.0. The client now closes the connection if the
broker sends a packet larger than this limit. This helps clients on
embedded devices to protect their limited memory. The default behavior
is unchanged: if no limit is set, only the protocol maximum of 256 MB
applies.
Change-Id: I26625325f490e2396fa493005c1f322253007a33
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
- this function should be used to protect your socket against receiving
too much data, which may eventually cause your application to run out
of memory.
- setSocketReadBufferSize(size) sets the size of internal read buffer
to be 'size' bytes.
[ChangeLog][QMqttClient] Added a readBufferSize property to limit
the transport buffer size.
Task-number: QTBUG-149866
Change-Id: I6ff843b66b50d019ecf620c25c47e0d779518113
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
- Document that disconnectFromHost() may block while waiting for pending
data to be written, with a timeout of up to 30 seconds.
- Recommend keeping QMqttClient and its transport outside the UI thread
because blocking I/O may occur and affect UI responsiveness.
Pick-to: 6.12
Task-number: QTBUG-150345
Change-Id: I27d300210750710c4a5138f8c3f97c7c929466af
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Disconnect with reason code 0x95 (Packet too large) if a packet
exceeds the Maximum Packet Size limit, as required by section 3.1.2.11.4
of the MQTT 5 spec.
Note: This fix doesn't protect against memory exhaustion in user apps.
It just implements the spec requirement about message limit.
Pick-to: 6.12
Task-number: QTBUG-149866
Change-Id: I2baa8ceb95e4a045437e2caa51e5508b2fa8b2eb
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
- When QMqttConnection reads a message, it keeps a count of the bytes
left to read -> by the dataSize argument. If a read fails, the count
is never reduced.
- The fix cleaning up the count of the bytes left to read, since
the reading is not working anymore and parsing should be stopped.
It allows to get read of potential freezes.
The patch also updates the QByteArray specialization to return a
default-constructed QBA in case of an error. This is more in line
with the default implementation.
Pick-to: 6.11 6.12 6.8
Task-number: QTBUG-149563
Change-Id: I8c8c5ef354103a996ac6e360fbc5c8f61d965f3d
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
- 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.12 6.8
Task-number: QTBUG-149569
Change-Id: Ib239d836556e0cc14e13c116dee757fdd1a7ae81
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
- 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>
Alternate text (alt text) improves the documentation experience for
screen readers and for other accessibility tools.
Task-number: QTBUG-135098
Pick-to: 6.11
Change-Id: Ia1793ff3e0bacd8cfdad2e8c04725a5093ed30aa
Reviewed-by: David Boddie <david.boddie@qt.io>
Mention that the transport uses QWebSocket, not QIODevice.
Technically, the implementation is still based on QIODevice, but that
is not what we want to highlight in the docs.
Amends dec643fc61.
Pick-to: 6.11 6.10
Change-Id: If561b3828cf8ffce4f245f7b4688a168a2ae3857
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
Reviewed-by: Even Oscar Andersen <even.oscar.andersen@qt.io>
The qmqttclient.cpp file contains parts of the MQTT protocol
implementation, and hence marked as security-critical.
The qmqtttopicname.cpp file contains the code that validates the topic
name and also parses the levels -> it is a data-parser, so should be
security-critical as well.
Amends 18548033e1, which incorrectly
marked these files as significant.
Not picking to 6.9 anymore, because that branch is already closed.
Task-number: QTBUG-135764
Pick-to: 6.10 6.8
Change-Id: I0e8b72fb1d24b7bbf6ac5edab63e137f9d36dd30
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
Not implementing this function causes a lot if Invalid Socket
Specified in the tests.
Also fixed a problem with broker_connection.h where
DefaultVersionTestData did not evaluate to version(0)
if MQTT_TEST_PROTOCOL was defined.
Fixes: QTBUG-137305
Pick-to: 6.10
Change-Id: I4b825196548a3f5bf07c3bb4203a0b46033004ba
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
The \generatelist command takes an optional argument
that affect how the members are listed, for example,
`classesbymodule` which creates an annotated list of
the classes in a named C++ module.
`groupsbymodule` is not recognized or documented. QDoc
falls back to generating a list of all members of a
group in this case. While the end result is correct,
this relies on an undocumented feature that is likely
to change and break.
Replace these instances with an explicit \annotatedlist
command that produces the same output.
Pick-to: 6.10
Task-number: QTBUG-138901
Change-Id: I4c36087ff39efc740bc938888aa2531f635d9b67
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Use the QUuid::Id128 format when converting a QUuid to string.
This format does not use curly braces and dashes, so we do not need
to remove them later.
Change-Id: I9b76c4eea03a4ba150e2a95ed8d108a6b1d9b8e6
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
This is the default level. All critical parts were identified in the
previous commits.
Fixes: QTBUG-135764
Pick-to: 6.10 6.9 6.8
Change-Id: Ib9df3db37e3efe3074f0fbc99eb60d31281d5a5a
Reviewed-by: Matthias Rauter <matthias.rauter@qt.io>
The QMqttTopicFilter::isValid() method parses the user-provided
string and validates it according to the MQTT protocol.
Task-number: QTBUG-135764
Pick-to: 6.10 6.9 6.8
Change-Id: I841bf83bbf29a2cdf4cf3faec93615a33f597241
Reviewed-by: Matthias Rauter <matthias.rauter@qt.io>
The qmqttconnection.cpp file implements parts of the MQTT protocol,
including proper packet generation
(e.g. in QMqttConnection::sendControlConnect()) and parsing
(e.g. in QMqttConnection::processDataHelper()).
The qmqttcontrolpacket.cpp file implements payload serialization
in QMqttControlPacket::serializePayload().
Task-number: QTBUG-135764
Pick-to: 6.10 6.9 6.8
Change-Id: I5b398c8739e549ba849fcc31f25cd05ca3384f30
Reviewed-by: Matthias Rauter <matthias.rauter@qt.io>
Since we could only have one subscription for each topic it was
not possible to return a new subscription when a subscription
request comes in on a topic that is scheduled for destruction.
We solve this by switching to a QMultiHash for the active
subscriptions, allowing more then one subscription for a
given topic. However, at most one of these subscriptions
are not present in the list of subscriptions scheduled to
be unsubscribed
This patch also changes multiple unsubscribes to the
same topic. Earlier all would return true, and
m_pendingUnsubscriptions would be updated for all
requests.
The new behavior is that only the first unsubscribe
is acted upon. Furthere requests will return false.
Fixes: QTBUG-135653
Pick-to: 6.8 6.9 6.10
Change-Id: I5a79efb68b3191e185325a89cc2042c773bb5c12
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
The earliest we can move this is right after `BuildInternals`. This
allows us to add function calls before navigating the `find_package`
tree of the dependents.
Task-number: QTBUG-135233
Change-Id: I2ee7bb0cb5addc422405768ba5706607a7257d6f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Added a \note, but keeping the example to show how to create custom
transports.
Pick-to: 6.10
Change-Id: Idf3b22532f6e0b94a0113cea6152a36e81398ea9
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Found in api-review.
Task-number: QTBUG-137478
Pick-to: 6.10
Change-Id: I73984caae5714c0f3cddd0f1770ddf19fd6fcd49
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
Moved declaration of the new connectToHostWebSocket[Secure]
afer connectToHostEncrypted
Task-number: QTBUG-137478
Pick-to: 6.10
Change-Id: I58ef8da23bf9759a1744908e02c6b9ef5db405f1
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
Currently installation is detected by looking for 'mqtt.conf' files,
which are set during provisioning in install-mosquitto-mqtt.sh
and install-mosquitto.ps1. However, this only reflects installation on
the build machine and not on test node. Therefore, add a way to disable
it on WOA also when cross compiled despite of existence of
'mqtt.conf' files on build node.
This is just barely a band aid patch as handling should be really done
during provisioning by Set-EnvironmentVariable, which than could be
read directly by test node as {{.Env.XXX}. However, it would also require the test to detect the setting during runtime and not during compile time.
Note the native arm64 windows setup has no mosquitto installation,
therefore this patch does not change anything for current native windows
arm setup, it only overrides setup for cross compilation node.
Task-number: COIN-1211
Change-Id: Ie6e84b6b04da48c1df284a388022f31ba1eea93e
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
`git-review` is a command line tool for interacting with Gerrit.
Some IDEs offer support for this tool, either natively or through
plugins. The tool relies on a configuration file, .gitreview. Adding
this configuration file to our repositories simplifies initial setup
for contributors that use the tool directly or through their IDE of
choice.
The configuration file adds a remote called 'gerrit'. This is the
default for the tool, and also the name set for
codereview.qt-project.org by Qt's `init-repository` script. Thus,
the configuration should work seamlessly alongside other repository
helpers.
Task-number: QTBUG-132604
Pick-to: 6.9 6.8
Change-Id: I5b2f0c79f58d97fcc9cb339d663d9cb15cd09c57
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
A QUIP 18[1] update sets git files, REUSE.toml and licenseRule.json
as infrastructure type files. They are licensed with:
LicenseRef-Qt-Commercial OR BSD-3-Clause
[1]: https://contribute.qt-project.org/quips/18
Pick-to: 6.9 6.8
Change-Id: I03d77977a9ee6e41d0a7b45dbe9dc3006c2cce83
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
This includes:
- turning VERIFY_SOURCE_SBOM ON
- adding exception to the licenseRule.json files
- correcting the licensing given via REUSE.toml files
A lot of files are skipped during the license test,
but all are present in the source SBOM.
This is why correction are needed before turning the
source SBOM check on.
Task-number: QTBUG-131434
Pick-to: 6.9
Change-Id: I5398523eafdae59a234bc2ed5ddd229c0aa923df
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
For at least one platform run the twelve combinations of:
Transport: [Tcp,Ssl,Ws,Wss]
Protocol: [3.1, 3.1.1, 5.0]
This happens if the following defines are present:
MQTT_TEST_BROKER
MQTT_TEST_TYPE
MQTT_TEST_PROTOCOL
If these are not defined, the old test behavior is kept
The logic is that we are replacing the type of VersionClient
to homegrown logic that replaces connectToHost with the
correct function:
connectToHost
connectToHostEncrypted,
connectToHostWebSocket
connectToHostWebSocketEncrypted
For this to work it is important that the VersionClient
macro is used everywhere.
Also, DefaultVersionTestData has been changed to
return version(0) if MQTT_TEST_PROTOCOL is defined,
we will now run one protocol at the time instead.
This is Change Request 2 of 2 wrt testing.
Task-number: QTBUG-129171
Change-Id: I4f68d7c2ea226a1107f009c80f87f8b749d9f120
Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io>
We want to use the VersionClient macro to iterate over
version,connectiontype. To do this (in a later patch)
it is necessary that VersionClient is used everywhere.
This is change request 1 of 2 wrt mqtt tests.
Task-number: QTBUG-129171
Change-Id: Ica2f97bc2fd130cc49191d7381d49e88e8dc4a0c
Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io>
Move the example IODevices to be used with websockets
under the mqtt umbrella.
Two (private) devices are created; QMqttSecureWebSocketIO
and QMqttWebSocketIO
Fixes: QTBUG-129171
Change-Id: Ib7d37150c3a229e882a0c04a32cdd8b7929baf3b
Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io>
Preparing for the add websocket change request.
Using shared_ptr gives automatic lifetime management
and is needed when adding more transport types.
Task-number: QTBUG-129171
Change-Id: I347175c018963130f403f8e9fe764e77203383a9
Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io>
The CMakeUserPresets.json file can be used to simplify configuring Qt,
particularly with tools such as Visual Studio and Visual Studio Code.
As opposed to the CMakePresets.json, the CMakeUserPresets.json should
only contain user specific configurations, and should never be checked
into source code management system.
This file is already ignored in the top level Qt super-project, but to
facilitate working with each individual submodule, we should also have
this .gitignore in each submodule.
Pick-to: 6.8
Change-Id: Ic12b3cce1b1082f206d076532f5d68452805ed08
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Even Oscar Andersen <even.oscar.andersen@qt.io>
This allows us to build manual tests together with Qt by specifying
QT_BUILD_MANUAL_TESTS and QT_BUILD_TESTS. A benefit of doing this, is
that the manual tests show up as debuggable targets with IDEs such as
Visual Studio Code, while keeping full code navigation capabilities into
the Qt code.
Pick-to: 6.8
Change-Id: Idd309c06fb2586fd634386951a3345aa40bc093a
Reviewed-by: Even Oscar Andersen <even.oscar.andersen@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
The example does not build with latest changes.
As it turns out there is a mismatch between the topic property
and the connected signal. Since the signal is not used, it is
removed in the hope that it will then build.
The error message from the build is:
Failure Summary:
The build failed due to a compilation error in 'qmlmqttclient.cpp'.
The function 'QmlMqttSubscription::topicChanged()' was called without
the required 'QString' argument.
Log snippet:
error: no matching function for call to ‘QmlMqttSubscription::topicChanged()’
note: candidate: ‘void QmlMqttSubscription::topicChanged(QString)’
note: candidate expects 1 argument, 0 provided
Change-Id: Ia8cedda578e2f2c082354892bd00cb9fd25b5652
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
REUSE.toml files are read by reuse to complement or override the
copyright and licensing information found in file.
The use of REUSE.toml files was introduced in REUSE version 3.1.0a1.
This reuse version is compatible with reuse specification
version 3.2 [1].
With this commit's files,
* The SPDX document generated by reuse spdx conforms to SPDX 2.3,
* The reuse lint command reports that the Qt project is reuse compliant.
In order to be reuse compliant all the licenses present in the
LICENSES directory must be used. License files not used are removed.
[1]: https://reuse.software/spec-3.2/
Task-number: QTBUG-124453
Task-number: QTBUG-125211
Pick-to: 6.8
Change-Id: If5891d7b09a559e55081ef4e9111d91eb49a6b14
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Include documentation testing steps in coin/module_config.yaml and
set the warning limit to zero.
Task-number: QTBUG-130559
Change-Id: I00593599b978406ec2fe166273be479d29f3a8e5
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
This commit organizes the articles, so they:
- have a reasonable tree structure
- can be navigated through the topic tree in the Qt Creator help viewer
Task-number: QTBUG-127289
Change-Id: I877bf1c62485161177ebe78f8326a4f979886cc5
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Declare them in a suitable header if they are used across multiple
unrelated files, otherwise use Q_STATIC_LOGGING_CATEGORY.
Unbreaks -Werror built.
Change-Id: Ic0759a2185be4288e8c7791c3a9cf22371d2d477
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
The behavior that argument was enabling is the default one now.
Pick-to: 6.8
Task-number: QTBUG-90492
Change-Id: I4e59f9ce590f76fd077cf1dafa7a423e6f958b5a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
As described in the ProtocolVersion enum description, MQTT Standard 5
is also a valid value.
Fixes: QTBUG-120947
Pick-to: 6.7 6.5 6.2 5.15
Change-Id: I27ed8ad1d31201abb195c35ab56ced3ad08494cc
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
The license test in qtqa reads this file
in order to check the validity of the license used.
This file reproduce the QUIP-18 [1] rules, with some exceptions.
Each entry in the file corresponds to a set of licensing rules.
A set of licensing rules can depend on the file ending,
registered in "file_pattern_ending". The last entry in the
file has no "file_pattern_ending", it sets the rules for the
files whose licensing does not depend on their ending.
The license to be used depends on the location
of the file within the Qt module repository.
Let's call this "<true_location>".
The "<true_location>" can also correspond to a file name,
offering flexibility for exceptions to the rule.
The "<true_location>" are registered in "location".
For each "<true_location>" there is a
"file type" entry and a "spdx" entry.
The "spdx" entry gives the rule:
the expected license tag(s) in SPDX format
for the file ending (if applicable) and "<true_location>".
The "file type" informs on the QUIP-18 type
the tested file corresponds to. It is purely informational
for the reader.
The set of rules are tested in order of appearance
in the json file. For this reason, a more constraining
ending (like "special.txt") needs to appear in
a "file_pattern_ending" located before
the "file_pattern_ending" of a less constraining ending (like ".txt").
Also, a file ending cannot be present in two "file_pattern_ending".
"file_pattern_ending" and "spdx" should list strings.
"<true_location>" can be regular expressions.
During the test the deeper "<true_location>" are
checked first. The order is which they appear in the json file
does not matter.
To test this file, run
QT_MODULE_TO_TEST=../qtmqtt perl tests/prebuild/license/tst_licenses.pl
[1]: https://contribute.qt-project.org/quips/18
Pick-to: 6.7
Task-number: QTBUG-121039
Change-Id: I240ee308911f5f49e45f25ea4cdbf21ce8a3e74c
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
According to QUIP-18 [1], all example files should be
LicenseRef-Qt-Commercial OR BSD-3-Clause
[1]: https://contribute.qt-project.org/quips/18
Pick-to: 6.7
Task-number: QTBUG-121787
Change-Id: I1133ca3b2daf487dbbc2ddae6b94d7f20239ed49
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
According to QUIP-18 [1], all test files should be
LicenseRef-Qt-Commercial OR GPL-3.0-only
[1]: https://contribute.qt-project.org/quips/18
Pick-to: 6.7
Task-number: QTBUG-121787
Change-Id: If63837f32f9f5e852292c20e449877e6a6fecc89
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
A topic can have multiple '+' wildcards, but isValid was searching for
the wrong wildcard at the second instance.
Pick-to: 6.6 6.5 6.2
Change-Id: I83e3fa258ef01b26388c0e6fd8c17a0a140ab75a
Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
The matching check for topic filters did not take into account that a
mixture of wildcards is valid. While # is only allowed a single time,
using + is valid in multiple occasions and can also me mixed with other
wildcards.
Fixes: QTBUG-104478
Pick-to: 6.6 6.5 6.2
Change-Id: I04129d5fbbb21c95115a15d74c6787804a8d0b10
Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
The \generate list names are added for each categorized section with
some explanation. Here, calling the overviews as
explanations-(name of the section). The idea is to give general terms
instead of specific phrases like 'core' etc, for better understanding.
Task-number: QTBUG-115347
Pick-to: 6.5 6.6
Change-Id: Ib33b450aa0919b0fd3e7a265cd2843af6c7d019c
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
This restores the QT_NO_FOREACH macro originally added in
9e7eba636e and then lost in the cmake
port.
Luckily, no new uses have crept in in the meantime.
Change-Id: Ief57253888dc910e5b424db64b2cd315033d4361
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
The autogenerated list of overviews was adding the \group command which
included all the groups instead of overviews.
The idea here is to categorize the overviews later on once we have
the list of all overviews.
Task-number: QTBUG-114762
Pick-to: 6.5 6.6
Change-Id: Icb72c8d987bfe6290c98635f062a890f37c939ac
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
Remove the call m_client.state(), it seems to be unnecessary (just like
in the Quicksubscription example).
Pick-to: 6.6 6.5
Task-number: QTBUG-110893
Change-Id: I460f12f3d4b33388013cb8250149239a6b0f1c94
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
Provide the missing documentation for the Quickpublication example
Task-number: QTBUG-110893
Change-Id: I002208e2e036a09acd68621f075bed7a11b6598f
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
The revamp includes:
- Update the screenshot
- Rename the example
- Add examplecategory : connectivity
- Update the description and snippets to reflect the current
state of the code
Task-number: QTBUG-110893
Change-Id: Id4edd325a539838fb5fa5c6b7fbbbfe4b0c683ce
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Remove m_client.state() call from QmlMqttClient::setPort, it seems to
be unnecessary.
Pick-to: 6.6 6.5
Task-number: QTBUG-110893
Change-Id: I4e1d8d2daf16da6c588f1b0b339ea863a22b32c0
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
Fix the qmllint warnings in the quickpublication example.
Pick-to: 6.6 6.5
Task-number: QTBUG-110893
Change-Id: If78a908807ee8a5f6f693d159a05a9ee91b1e38d
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Remove the version numbers according to revamp the guideline.
Pick-to: 6.6 6.5
Task-number: QTBUG-110893
Change-Id: I9e8fdd0fa54b3218efd2c55bd3dac3137d43e756
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
Fix the qmllint warnings in the quicksubscription example.
Pick-to: 6.6 6.5
Task-number: QTBUG-110893
Change-Id: I4f633573b8c8f28eb65d7d4a57d4a63d8b7f5881
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Remove the version numbers according to the guideline
Task-number: QTBUG-110893
Change-Id: I5e1bf98a6180be039f385a8e4376dcd01df2e8c4
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
Use the list initializer constructor of QStringList to make the code
more modern/compact.
Task-number: QTBUG-110893
Change-Id: Idf1cfb400e19cad87b70a40735fa17c87cf7fb30
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
As part of revamping the MQTT examples, replace QLatin1Strings with
_L1 literals.
Also replace QLatin1Chars and QStringLiterals with the appropriate
u'' and u""_s literals.
Task-number: QTBUG-110893
Change-Id: I784f5faa23e51666b6edf36eb9692c0f7c186f70
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
The conan experiment has ended, and the file is only bitrotting
nowadays.
Pick-to: 6.5 6.6
Change-Id: I26d08e441a8d049fe0a3d04236824c14988bd624
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
When using a websocket as the underlying IO device we must specify
that the device is sequential, to avoid spurious protocol violation
condition when packets are split across websocket frame boundaries.
The standard specifically states: "The receiver MUST NOT assume that
MQTT Control Packets are aligned on WebSocket frame boundaries."
New MQTT brokers like FlashMQ rely on well-behaved receivers.
Change-Id: Ia8e7fb0cf1cc518b364625b1955fb6b9ee44b7ef
Pick-to: 6.5
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
Remove "Example" from the name of the example.
Add examplecategory.
Add a short explanation and a few code snippets.
Task-number: QTBUG-110893
Change-Id: I0e4e29b9cd86c4950fdd0263ecec54e8927b2c3c
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
The function sets the required CMake variables and policies.
Pick-to: 6.5
Task-number: QTBUG-112685
Change-Id: I11a1f26d27e77234a5f4097efd13723e9f9ce01b
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
Fix some warnings that were reported by the MSVC compiler with the Wall
setting:
- use static_cast for signed/unsigned conversion
- use QString::fromUtf8 instead of the QByteArray constructor
Pick-to: 6.5
Task-number: QTBUG-110893
Change-Id: Ic982d3c16feb1ebcef729b4dfd023cc3b5017fec
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Remove the word "Example" from the name of the example.
Add the example to the "Connectivity" Category.
Update the screenshot - the example no longer has a ping button.
Task-number: QTBUG-110893
Change-Id: Ieedb32800804fc336ba0e3bd0c8f3b9e4cd13527
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Fix some signed/unsigned conversion warnings in the Simple Client
example reported by Visual Studio with the Wall compiler settings.
Pick-to: 6.5
Task-number: QTBUG-110893
Change-Id: I0a1851098d314c63195eb2366a6f87f42a4bbed4
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
Fix some signed/unsigned conversion warnings.
Add explicit QMqttSubscription::Unsubscription case.
These warnings were reported by Visual Studio with the Wall compiler
setting.
Pick-to: 6.5
Task-number: QTBUG-110893
Change-Id: Ief64c4a04ba679f52c3e256aa96bb8f239ae68e9
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
According to the guideline "Example" should be not part of the name of
the example - remove it.
Add example to the Connectivity category.
Update the screenshot as the current one is obsolete. The application
no longer has a ping button but it has username and password fields.
Task-number: QTBUG-110893
Change-Id: Id9608ea6e76a3a7e89b0fd491d9fb329cfcbedc3
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
The example is not documented and it is also missing from the
examples-manifest.xml file. However, it can be still useful
for debugging or for performing small tests, so move it to
the tests/manual folder.
The qmake project files are kept for the examples because the
CI builds the examples with CMake and qmake. Now that this has
been moved to tests/manual, the .pro files can be removed.
Change-Id: Id69c3c6896d98b543ff5bd493592d06a27746496
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
On Windows, sending DISCONNECT might return data before the
QMqttConnection is destroyed, causing it to invoke on bogus QMqttClient
members.
Hence, set a flag to avoid this event, but still aim to send a
disconnect to the broker to nicely quit.
Fixes: QTBUG-111846
Pick-to: 6.5 6.4 6.2
Change-Id: Ia94865c9b404ecbd814150c313679aa10b3f6aa0
Reviewed-by: Mate Barany <mate.barany@qt.io>
Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
As we are now processing the arguments with
cmake_parse_arguments(PARSE_ARGV, we don't need to pass the escape
characters anymore.
Task-number: QTBUG-99238
Change-Id: I8dbdad71e6a5b40e944c55c35dd4c772af6b5665
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Option has not effect anymore.
Pick-to: 6.5
Change-Id: I06ba72c237d47a7287fb1f9f347a4467b3c5e87d
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.