-
Notifications
You must be signed in to change notification settings - Fork 7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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>
- Loading branch information
1 parent
445d006
commit aec5f0a
Showing
2 changed files
with
23 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters