From b622aaeee48fd06e825ad04f35f30ff464586255 Mon Sep 17 00:00:00 2001 From: "Roger A. Light" Date: Thu, 31 Oct 2019 12:56:13 +0000 Subject: [PATCH] Fix messages with an expiry interval missing the property. They would be be sent without an expiry interval property just before they were expired. Closes #1464. Thanks to Dustin Sallings. --- ChangeLog.txt | 2 ++ src/subs.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index acdaf0e4..8070f019 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -11,6 +11,8 @@ Broker: Closes #1459. - Fix retained messages with an expiry interval not being expired after being restored from persistence. Closes #1464. +- Fix messages with an expiry interval being sent without an expiry interval + property just before they were expired. Closes #1464. Client library: - Fix publish properties not being passed to on_message_v5 callback for QoS 2 diff --git a/src/subs.c b/src/subs.c index fc62bef8..cf71a1fb 100644 --- a/src/subs.c +++ b/src/subs.c @@ -987,7 +987,7 @@ static int retain__process(struct mosquitto_db *db, struct mosquitto__subhier *b mosquitto_property *properties = NULL; struct mosquitto_msg_store *retained; - if(branch->retained->message_expiry_time > 0 && now > branch->retained->message_expiry_time){ + if(branch->retained->message_expiry_time > 0 && now >= branch->retained->message_expiry_time){ db__msg_store_ref_dec(db, &branch->retained); branch->retained = NULL; #ifdef WITH_SYS_TREE