Merge branch 'bugfix/missing_unlock_and_cleanup' into 'master'

Minor fixes and cleanup

See merge request espressif/esp-mqtt!81
This commit is contained in:
David Čermák
2020-11-18 16:44:41 +08:00
3 changed files with 3 additions and 3 deletions

View File

@ -84,8 +84,8 @@
#endif
#endif
#ifdef CONFIG_OUTBOX_EXPIRED_TIMEOUT_MS
#define OUTBOX_EXPIRED_TIMEOUT_MS CONFIG_OUTBOX_EXPIRED_TIMEOUT_MS
#ifdef CONFIG_MQTT_OUTBOX_EXPIRED_TIMEOUT_MS
#define OUTBOX_EXPIRED_TIMEOUT_MS CONFIG_MQTT_OUTBOX_EXPIRED_TIMEOUT_MS
#else
#define OUTBOX_EXPIRED_TIMEOUT_MS (30*1000)
#endif

View File

@ -16,7 +16,6 @@ typedef struct outbox_item {
int msg_type;
int msg_qos;
outbox_tick_t tick;
int retry_count;
pending_state_t pending;
STAILQ_ENTRY(outbox_item) next;
} outbox_item_t;

View File

@ -1494,6 +1494,7 @@ esp_err_t esp_mqtt_client_stop(esp_mqtt_client_handle_t client)
/* A running client cannot be stopped from the MQTT task/event handler */
TaskHandle_t running_task = xTaskGetCurrentTaskHandle();
if (running_task == client->task_handle) {
MQTT_API_UNLOCK(client);
ESP_LOGE(TAG, "Client cannot be stopped from MQTT task");
return ESP_FAIL;
}