fix bug: client->state not set
If auto_reconnect is disabled, client->state won't be setted in MQTT_STATE_WAIT_TIMEOUT statement, which results in an error if esp_mqtt_client_start() is called.
This commit is contained in:
1 parent
15818b3a50
commit
57d2774462
1 file changed
+1
@@ -891,6 +891,7 @@ static void esp_mqtt_task(void *pv)
|
||||
|
||||
if (!client->config->auto_reconnect) {
|
||||
client->run = false;
|
||||
client->state = MQTT_STATE_UNKNOWN;
|
||||
break;
|
||||
}
|
||||
if (platform_tick_get_ms() - client->reconnect_tick > client->wait_timeout_ms) {
|
||||
|
||||
Reference in new issue
Block a user