Repository navigation
mqtt status: name the TLS handshake state - #1
Merged
schikani merged 1 commit intoOct 4, 2026
Merged
Conversation
While a TLS connection was being set up (or -r retried one), `mqtt status` printed "MQTT: not connected" above "TLS handshake with ...". state_name() now lists every state without a default, so -Wswitch catches a new one.
Collaborator
|
Thanks, real bug and a clean fix. Builds and tests pass here on MinGW too. Merging. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed for users
mqtt statusprintedMQTT: not connectedwhile a TLS connection was beingset up, directly above the status text
TLS handshake with <broker>....It now prints
MQTT: TLS handshake.It shows when the connection was started from the MQTT app, or by
mqtt connect -rwhile it retries (every retry goes through the handshakeagain).
The change
state_name()inports/common/td_proto_cmds.chad no case forTD_MQTT_TLS_HANDSHAKE, so it fell through todefault. The switch now listsevery
td_mqtt_state_tvalue and has nodefault, so-Wswitch(part of-Wall; the builds use-Werror) reports a state added later. No API change.Tested
(mbedTLS v3.6.7, as in CI): no warnings, all 7 CTest programs pass.
client stays in the handshake:
mqtt connect -r mqtts://127.0.0.1:18883,then
mqtt statusafter the first retry.MQTT: not connectedMQTT: TLS handshakemqtt statuswith no connection still printsMQTT: not connected. The CIsmoke tests (echo through the shell; mqtts reaches "Connecting to") pass.
enumeration value 'TD_MQTT_TLS_HANDSHAKE' not handled in switch.is plain C; CI builds all three boards.