fix: Error on publish message creation was ignored.

In the case of make_publish failure the client would just continue and
the error was ignored and not propagated to caller.
This commit is contained in:
Euripedes Rocha
2023-06-27 15:13:54 +02:00
parent effd1e6705
commit 585e3ba2e0

View File

@@ -1976,6 +1976,9 @@ static inline int mqtt_client_enqueue_publish(esp_mqtt_client_handle_t client, c
int len, int qos, int retain, bool store)
{
int pending_msg_id = make_publish(client, topic, data, len, qos, retain);
if (pending_msg_id < 0) {
return -1;
}
/* We have to set as pending all the qos>0 messages */
//TODO: client->mqtt_state.outbound_message = publish_msg;
if (qos > 0 || store) {