From 880df7360dd8b8d3f51dbcc1dc2031a3b22a1672 Mon Sep 17 00:00:00 2001 From: Roger Light Date: Mon, 17 May 2021 00:49:44 +0100 Subject: [PATCH] Fix bridge not reconnectng if the first reconnection attempt fails. Closes #2207. Thanks to Abilio Marques. --- ChangeLog.txt | 2 ++ src/bridge.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 25a84084..3fe8c667 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -5,6 +5,8 @@ Broker: - Fix possible crash having just upgraded from 1.6 if `per_listener_settings true` is set, and a SIGHUP is sent to the broker before a client has reconnected to the broker. Closes #2167. +- Fix bridge not reconnectng if the first reconnection attempt fails. + Closes #2207. Clients: - If sending mosquitto_sub output to a pipe, mosquitto_sub will now detect diff --git a/src/bridge.c b/src/bridge.c index f55315fb..961b6a72 100644 --- a/src/bridge.c +++ b/src/bridge.c @@ -837,7 +837,7 @@ void bridge_check(void) { rc = bridge__connect(context); context->bridge->restart_t = 0; - if(rc == MOSQ_ERR_SUCCESS){ + if(rc == MOSQ_ERR_SUCCESS || rc == MOSQ_ERR_CONN_PENDING){ if(context->bridge->round_robin == false && context->bridge->cur_address != 0){ context->bridge->primary_retry = db.now_s + 5; }