Skip to content

Commit

Permalink
Fix mosquitto_publish*() no longer returning MOSQ_ERR_NO_CONN.
Browse files Browse the repository at this point in the history
This was always returning success when the client was not connected.

Closes #1725. Thanks to BOTorioN.
  • Loading branch information
ralight committed Jul 15, 2020
1 parent b4e0dfa commit d371b3c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions ChangeLog.txt
Expand Up @@ -14,6 +14,8 @@ Broker:

Client library:
- Improved documentation around connect callback return codes. Close #1730.
- Fix `mosquitto_publish*()` no longer returning `MOSQ_ERR_NO_CONN` when not
connected. Closes #1725.


1.6.10 - 2020-05-25
Expand Down
4 changes: 2 additions & 2 deletions lib/actions.c
Expand Up @@ -151,9 +151,9 @@ int mosquitto_publish_v5(struct mosquitto *mosq, int *mid, const char *topic, in

pthread_mutex_lock(&mosq->msgs_out.mutex);
message->state = mosq_ms_invalid;
message__queue(mosq, message, mosq_md_out);
rc = message__queue(mosq, message, mosq_md_out);
pthread_mutex_unlock(&mosq->msgs_out.mutex);
return MOSQ_ERR_SUCCESS;
return rc;
}
}

Expand Down

0 comments on commit d371b3c

Please sign in to comment.