Skip to content

Commit

Permalink
Fix ref counting of retained messages.
Browse files Browse the repository at this point in the history
  • Loading branch information
ralight committed Mar 26, 2020
1 parent 0b7b738 commit 95faff3
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions src/database.c
Original file line number Diff line number Diff line change
Expand Up @@ -626,10 +626,6 @@ int db__messages_easy_queue(struct mosquitto_db *db, struct mosquitto *context,
}
if(db__message_store(db, context, 0, topic_heap, qos, payloadlen, &payload_uhpa, retain, &stored, message_expiry_interval, local_properties, 0, origin)) return 1;

if(retain){
stored->ref_count++;
}

return sub__messages_queue(db, source_id, topic_heap, qos, retain, &stored);
}

Expand Down Expand Up @@ -915,9 +911,6 @@ int db__message_release_incoming(struct mosquitto_db *db, struct mosquitto *cont
* denied/dropped and is being processed so the client doesn't
* keep resending it. That means we don't send it to other
* clients. */
if(retain){
tail->store->ref_count++;
}
if(topic == NULL){
db__message_remove(db, &context->msgs_in, tail);
deleted = true;
Expand Down

0 comments on commit 95faff3

Please sign in to comment.