Also, remove optional dependency to websockets, which is not
part of Qt 6.0 and fix compile error against unsigned comparison.
Switch default test configuration to not launch TLS brokers.
Latest COIN updates causes paho to fail in the SSL setup.
Task-number: QTBUG-88189
Change-Id: I9d31f9e54801d269122878ab4cf7541512fdbe98
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
when QMqttClient gets destroyed in Connected state, d->m_connection
in its destructor (indirectly called by ~QObject) sends DISCONNECT
Control packet and then closes connection, causing
transportConnectionClosed() to call m_clientPrivate->setStateAndError(),
which, in its turn, accesses [a partially destroyed] QMqttClient instance
Change-Id: I216f700d92838dc25e385fe2d449f3ad93a642e6
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
Required to also enable CMake CI configurations.
Change-Id: I20099cb8a1a41e210bff6a157e84ed718efb4396
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
And use an updated coin instruction file.
Change-Id: I852d38febe9ecaa86c516b7f4a0451d0f80d8011
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
UNSUBACK supported properties are exactly the same as SUBACK ones,
so re-use the existing readSubscriptionProperties() implementation.
Change-Id: I1d3d99f33d44882505960b603a07237c2a578dcb
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
the state of a respective subscription is updated by the UNSUBACK handler,
once the broker confirms unsubscription
(see QMqttConnection::finalize_unsuback() for details)
Change-Id: Ib5c06dc7813609a66fad577d594447fade357a3e
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
by assuming a non-empty payload and then failing to read the data
if that assumption was too optimistic.
As per [MQTT-3.8.3-2]:
> The Payload MUST contain at least one Topic Filter and Subscription Options pair.
> A SUBSCRIBE packet with no Payload is a Protocol Error.
and then as per [MQTT-3.9.3-1]:
> The Payload contains a list of Reason Codes. Each Reason Code corresponds to a Topic Filter in the SUBSCRIBE packet being acknowledged.
> The order of Reason Codes in the SUBACK packet MUST match the order of Topic Filters in the SUBSCRIBE packet.
Change-Id: I5939d901c897f679ece43b3ec3845c43ee6f2a47
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
plus add some more verbosity on invalid argument values
Change-Id: I7e0a091c2603e16d3e1d90f116e3f134122d42a2
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
all reason codes are of a single byte long
Change-Id: I65c223bf034aab1f2a03934ffb1cdc841f4aa8c5
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
The exceptional texts in 3.4.2.1, 3.5.2.1, 3.6.2.1, 3.7.2.1,
3.14.2.1 and 3.15.2.1 propose a micro optimization:
> The Reason Code and Property Length can be omitted
> if the Reason Code is 0x00 (Success) and there are no Properties.
which our current implementation treats like if it were
"The Property Length can be omitted if the Reason Code is 0x00".
In theory, this optimization could apply to CONNACK as well,
as there is a reason code and no payload, but that's not stated
anywhere in the spec and should not be assumed.
Change-Id: Ifaf9a3c45876661b8f7a4d688600f53b46288752
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
prohibit reason codes not allowed for MQTT 5 PUBACK/REC/REL/COMP
(see sections 3.4.2.1, 3.5.2.1, 3.6.2.1, 3.7.2.1 for details)
Change-Id: If33a704e2667f07c9e2b79f6aa4fc241406fd892
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
change readVariableByteInteger() to decrease the passed value
(just like other read* functions) and remember to decrease
the remaining bytes counter by the properties length
when we read properties
(otherwise we're getting a reasonable Q_ASSERT(m_missingData == 0)
after i.e. readSubscriptionProperties())
Change-Id: Iaa050b1b543da2186da8e4deb1e701f4ac2ac2fa
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
Some test servers might have different configurations.
For instance, mosquitto broker provides a different
default value for topic aliases.
Change-Id: I00bc9c6b27d06358a352f9c0adb04e4044666aac
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
mosquitto MQTT5 support seems to wait longer to send
will messages.
Change-Id: I2c13609e228319ce8fefc5e79d4f99bbfe0b061b
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
prohibit reason codes not allowed for MQTT <=5 SUBACK
(see section 3.9.3 for details)
Change-Id: Ic433d14cd1c787da584e311c04273b676f4b450a
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* map MQTT 5 reason codes to a legacy ClientError values
* prohibit reason codes not allowed for MQTT 5 CONNACK
(see section 3.2.2.2 for details)
Change-Id: Ia5f5c2a55c9cf7477409b7f5bf670768b42eb979
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
squash finalize_pubAckRecComp() with finalize_pubrel()
Change-Id: I1a14d1ca0efccbfc58edafe0eaf27d58543ac82a
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
As a follow up to 8b90d4808f
specify the version that the AUTH related enums have
been introduced.
Change-Id: I3f03a16504091f030e32bb97f9cae4e9b0864c62
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
as of MQTT 5, DISCONNECT Control packet could be sent
from the Client or the Server, however QMqttControlPacket::DISCONNECT
wasn't handled in the switch, causing connection close
with ProtocolViolation error.
Change-Id: Ic908f4e51ad133aff90cac1c65aa6df7eb21a427
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
instead, postpone the transportConnectionEstablished() call from
QSslSocket's Connected to Encrypted state
Change-Id: I4ed146897c6b084c3dd19848655a3c28979175ba
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
Change-Id: I530ca158ca01a4d793bad9a5ea2eaf12f6098506
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
as per 3.3.4
> A PUBLISH packet sent from a Client to a Server MUST NOT contain a Subscription Identifier
Change-Id: I490d46cdb346b0ebcd47f333ff410835a9c30733
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>