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:
leewo0
2019-01-15 15:40:07 +08:00
committed by Tommy
parent 15818b3a50
commit 57d2774462

View File

@ -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) {