Permalink
Browse files

[191] Fix some $SYS messages being incorrectly persisted.

Closes #191.

Bug: #191
  • Loading branch information...
1 parent 23113bb commit 2c54104ce3b12ad0213a374103bacd04e4f673d8 @ralight ralight committed Jun 21, 2016
Showing with 2 additions and 1 deletion.
  1. +1 −0 ChangeLog.txt
  2. +1 −1 src/persist.c
View
@@ -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.
View
@@ -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;

0 comments on commit 2c54104

Please sign in to comment.