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

Closes #191.

Bug: https://github.com/eclipse/mosquitto/issues/191
This commit is contained in:
Roger A. Light 2016-06-21 17:17:23 +01:00
parent 23113bb5f5
commit 2c54104ce3
2 changed files with 2 additions and 1 deletions

View File

@ -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 File

@ -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;