From 4e0312c55f5cdf179ffca6f26e2087196f730db8 Mon Sep 17 00:00:00 2001 From: "Roger A. Light" Date: Wed, 15 Jul 2020 17:08:00 +0100 Subject: [PATCH] Fix messages being queued for disconnected bridges This occurred incorrectly when clean start was set to true. Closes #1729. Thanks to Andreyooo. --- ChangeLog.txt | 2 ++ src/database.c | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/ChangeLog.txt b/ChangeLog.txt index 5bfb045c..e818ce16 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -7,6 +7,8 @@ Broker: - Don't quit with an error if opening the log file isn't possible. Closes #821. - Fix bridge topic remapping when using "" as the topic. Closes #1749. +- Fix messages being queued for disconnected bridges when clean start was + set to true. Closes #1729. Client library: - Improved documentation around connect callback return codes. Close #1730. diff --git a/src/database.c b/src/database.c index 11980d7a..ef509db0 100644 --- a/src/database.c +++ b/src/database.c @@ -394,6 +394,10 @@ int db__message_insert(struct mosquitto_db *db, struct mosquitto *context, uint1 } } } + if(context->bridge && context->bridge->clean_start == true){ + mosquitto_property_free_all(&properties); + return 2; + } } if(context->sock != INVALID_SOCKET){