Skip to content

Commit

Permalink
Fix documentation omission around mosquitto_reinitialise.
Browse files Browse the repository at this point in the history
Closes #2489. Thanks to rroguski
  • Loading branch information
ralight committed Aug 10, 2022
1 parent 351911b commit 6468bb4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions ChangeLog.txt
Expand Up @@ -27,6 +27,7 @@ Client library:
- Fix incorrect use of SSL_connect. Closes #2594.
- Don't set SIGPIPE to ignore, use MSG_NOSIGNAL instead. Closes #2564.
- Add documentation of struct mosquitto_message to header. Closes #2561.
- Fix documentation omission around mosquitto_reinitialise. Closes #2489.

Clients:
- Fix mosquitto_pub incorrectly reusing topic aliases when reconnecting.
Expand Down
7 changes: 4 additions & 3 deletions include/mosquitto.h
Expand Up @@ -346,9 +346,10 @@ libmosq_EXPORT void mosquitto_destroy(struct mosquitto *mosq);
* callbacks that are specified.
*
* Returns:
* MOSQ_ERR_SUCCESS - on success.
* MOSQ_ERR_INVAL - if the input parameters were invalid.
* MOSQ_ERR_NOMEM - if an out of memory condition occurred.
* MOSQ_ERR_SUCCESS - on success.
* MOSQ_ERR_INVAL - if the input parameters were invalid.
* MOSQ_ERR_NOMEM - if an out of memory condition occurred.
* MOSQ_ERR_MALFORMED_UTF8 - if the client id is not valid UTF-8.
*
* See Also:
* <mosquitto_new>, <mosquitto_destroy>
Expand Down
3 changes: 3 additions & 0 deletions lib/mosquitto.c
Expand Up @@ -163,6 +163,9 @@ int mosquitto_reinitialise(struct mosquitto *mosq, const char *id, bool clean_st
return MOSQ_ERR_MALFORMED_UTF8;
}
mosq->id = mosquitto__strdup(id);
if(!mosq->id){
return MOSQ_ERR_NOMEM;
}
}
mosq->in_packet.payload = NULL;
packet__cleanup(&mosq->in_packet);
Expand Down

0 comments on commit 6468bb4

Please sign in to comment.