Merge branch 'bugfix/return_on_qos0_disconnected' into 'master'

bug: Incorrect return on disconnect qos0 publish

See merge request espressif/esp-mqtt!172

(cherry picked from commit fa40f44695fc4a0cde14a31a01b8a03da14dd702)

58c25577 bug: Incorrect return on disconnect qos0 publish
This commit is contained in:
Rocha Euripedes
2023-05-31 19:15:56 +08:00
parent b2bd8e5f49
commit 5bd9724c69

View File

@ -235,7 +235,7 @@ esp_mqtt_set_transport_failed:
/* Checks if the user supplied config values are internally consistent */
static esp_err_t esp_mqtt_check_cfg_conflict(const mqtt_config_storage_t *cfg, const esp_mqtt_client_config_t *user_cfg)
{
if(cfg == NULL || user_cfg == NULL) {
if (cfg == NULL || user_cfg == NULL) {
ESP_LOGE(TAG, "Invalid configuration");
return ESP_ERR_INVALID_ARG;
}
@ -2007,6 +2007,8 @@ int esp_mqtt_client_publish(esp_mqtt_client_handle_t client, const char *topic,
ESP_LOGD(TAG, "Publish: client is not connected");
if (qos > 0) {
ret = pending_msg_id;
} else {
ret = -1;
}
// delete long pending messages