From ebfebf870836c46299133f548449f0e93ca3c27b Mon Sep 17 00:00:00 2001 From: "Roger A. Light" Date: Wed, 25 May 2022 16:20:15 +0100 Subject: [PATCH] Fix bridges not sending failure notification messages. This is for messages to the local broker if the remote bridge connection fails. Closes #1488. Closes #2467. --- ChangeLog.txt | 2 ++ lib/util_mosq.c | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/ChangeLog.txt b/ChangeLog.txt index 3b107be0..f5029030 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -13,6 +13,8 @@ Broker: Closes #2404. - Add clients to session expiry check list when restarting and reloading from persistence. Closes #2546. +- Fix bridges not sending failure notification messages to the local broker if + the remote bridge connection fails. Closes #2467. Closes #1488. Client library: - Fix threads library detection on Windows under cmake. Bumps the minimum diff --git a/lib/util_mosq.c b/lib/util_mosq.c index fda69801..65fc5f7d 100644 --- a/lib/util_mosq.c +++ b/lib/util_mosq.c @@ -104,6 +104,12 @@ int mosquitto__check_keepalive(struct mosquitto *mosq) pthread_mutex_unlock(&mosq->msgtime_mutex); }else{ #ifdef WITH_BROKER +# ifdef WITH_BRIDGE + if(mosq->bridge){ + context__send_will(mosq); + } +# endif +#endif net__socket_close(mosq); #else net__socket_close(mosq);