Skip to content

Commit 3738fcd

Browse files
Moves state change when stopping the client
- In some situations client could be left in a state where it's impossible to restart due to a state change while waiting for the stop. This guarantee that it's possible to start after calling stop. Closes #239
1 parent 5f297c0 commit 3738fcd

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

mqtt_client.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1653,6 +1653,7 @@ static void esp_mqtt_task(void *pv)
16531653
esp_transport_close(client->transport);
16541654
outbox_delete_all_items(client->outbox);
16551655
xEventGroupSetBits(client->status_bits, STOPPED_BIT);
1656+
client->state = MQTT_STATE_DISCONNECTED;
16561657

16571658
vTaskDelete(NULL);
16581659
}

0 commit comments

Comments
 (0)