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 authored and Tommy committed 2019-02-20 16:49:46 +08:00
1 parent 15818b3a50
commit 57d2774462
1 file changed
+1
+1
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) {