Skip to content

Commit

Permalink
[191] Fix some $SYS messages being incorrectly persisted.
Browse files Browse the repository at this point in the history
Closes #191.

Bug: #191
  • Loading branch information
ralight committed Jun 21, 2016
1 parent 23113bb commit 2c54104
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions ChangeLog.txt
Expand Up @@ -5,6 +5,7 @@ Broker:
- Fix TLS operation with websockets listeners and libwebsockts 2.x. Closes
#186.
- Don't disconnect client on HUP before reading the pending data. Closes #7.
- Fix some $SYS messages being incorrectly persisted. Closes #191.

Build:
- Don't attempt to install docs when WITH_DOCS=no. Closes #184.
Expand Down
2 changes: 1 addition & 1 deletion src/persist.c
Expand Up @@ -140,7 +140,7 @@ static int mqtt3_db_message_store_write(struct mosquitto_db *db, FILE *db_fptr)
stored = db->msg_store;
while(stored){
if(stored->topic && !strncmp(stored->topic, "$SYS", 4)){
if(stored->ref_count == 1 && stored->dest_id_count == 0){
if(stored->ref_count <= 1 && stored->dest_id_count == 0){
/* $SYS messages that are only retained shouldn't be persisted. */
stored = stored->next;
continue;
Expand Down

0 comments on commit 2c54104

Please sign in to comment.