Skip to content

Fix broker session persistence and nonblocking CONTINUE handling - #575

Merged
embhorn merged 5 commits into
wolfSSL:masterfrom
aidangarske:fenrir-fixes-10331-10334-10335-10336-10338
Aug 18, 2026
Merged

Fix broker session persistence and nonblocking CONTINUE handling#575
embhorn merged 5 commits into
wolfSSL:masterfrom
aidangarske:fenrir-fixes-10331-10334-10335-10336-10338

Conversation

@aidangarske

Copy link
Copy Markdown
Member
F-10334, F-10338, F-10336, F-10331, F-10335

@aidangarske aidangarske self-assigned this Aug 17, 2026
Copilot AI lite review requested due to automatic review settings August 17, 2026 21:46

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@aidangarske
aidangarske requested review from dgarske and embhorn and removed request for dgarske August 17, 2026 22:18
@aidangarske
aidangarske marked this pull request as ready for review August 17, 2026 22:51

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

Suppressed comments (2)

src/mqtt_broker.c:5512

  • sub->client->connack_pending_len is referenced inside the WOLFMQTT_V5 QoS0 path, but the BrokerClient member is excluded under WOLFMQTT_STATIC_MEMORY. This will not compile for v5 + static-memory configurations.
            /* QoS 0 is best effort; skip while tx_buf holds an in-flight
             * CONNACK. */
            else if (sub->client->connack_pending_len == 0)
#endif
            {

src/mqtt_sn_client.c:2163

  • In WOLFMQTT_NONBLOCK, MqttPacket_Write() can return MQTT_CODE_CONTINUE for a partial send. This function currently treats any rc != client->write.len as a failure (and in multithread mode removes the pending response), but it does not track a send-in-progress state (e.g., MQTT_MSG_HEADER) like other MQTT-SN flows in this file (see SN_WillTopic). This can cause retries to re-add/remove the pending response incorrectly and lose the ability to safely resume the in-flight write.
        /* Send disconnect packet */
        rc = MqttPacket_Write(client, client->tx_buf, client->write.len);
        if (rc != client->write.len) {
        #ifdef WOLFMQTT_MULTITHREAD
            wm_SemUnlock(&client->lockSend);

Comment thread src/mqtt_broker.c
@embhorn
embhorn merged commit e64c1ac into wolfSSL:master Aug 18, 2026
47 of 48 checks passed
@aidangarske
aidangarske deleted the fenrir-fixes-10331-10334-10335-10336-10338 branch August 18, 2026 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants