zephyr/subsys/net/lib/mqtt
Robert Lubos aec5f0a3ef net: mqtt: Prevent double CONNACK event notification on server reject
Currently, the application could receive a duplicate CONNACK event, in
case the server rejected the connection at MQTT level (with an error
code provided with CONNACK message). A subsequent connection close (with
`mqtt_abort` for instance) would produce the duplicate event.

Fix this by reporting back to the MQTT engine, that the connection was
refused, so it can close the connection rightaway. Rework the event
notification logic, so that DISCONNECT event instead of a duplicate
CONNACK event is notified in that case.

Also, prevent the MQTT engine from notyfing DISCONNECT event in case of
socket errors during initial connection phase (i. e. before
`mqtt_connect` function finished).

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2020-07-27 13:24:11 +02:00
..
CMakeLists.txt net: mqtt: Add support for running MQTT over Websocket 2019-10-04 18:48:10 -07:00
Kconfig net: mqtt: Make client "cleansession" flag configurable. 2020-06-09 10:09:04 +03:00
mqtt_decoder.c zephyr: replace zephyr integer types with C99 types 2020-06-08 08:23:57 -05:00
mqtt_encoder.c zephyr: replace zephyr integer types with C99 types 2020-06-08 08:23:57 -05:00
mqtt_internal.h net: mqtt: Make client "cleansession" flag configurable. 2020-06-09 10:09:04 +03:00
mqtt_os.h zephyr: replace zephyr integer types with C99 types 2020-06-08 08:23:57 -05:00
mqtt_rx.c net: mqtt: Prevent double CONNACK event notification on server reject 2020-07-27 13:24:11 +02:00
mqtt_transport_socket_tcp.c zephyr: replace zephyr integer types with C99 types 2020-06-08 08:23:57 -05:00
mqtt_transport_socket_tls.c zephyr: replace zephyr integer types with C99 types 2020-06-08 08:23:57 -05:00
mqtt_transport_websocket.c zephyr: replace zephyr integer types with C99 types 2020-06-08 08:23:57 -05:00
mqtt_transport.c zephyr: replace zephyr integer types with C99 types 2020-06-08 08:23:57 -05:00
mqtt_transport.h zephyr: replace zephyr integer types with C99 types 2020-06-08 08:23:57 -05:00
mqtt.c net: mqtt: Prevent double CONNACK event notification on server reject 2020-07-27 13:24:11 +02:00