From 326983d35eb1e0807843671ba7794032bede5164 Mon Sep 17 00:00:00 2001 From: "Roger A. Light" Date: Mon, 19 Jun 2017 17:15:00 +0100 Subject: [PATCH] [417] Fix lazy bridges not timing out for idle_timeout. Thanks to spinachmedia. Bug: https://github.com/eclipse/mosquitto/issues/417 --- ChangeLog.txt | 1 + lib/util_mosq.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index b98c5513..9272af78 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,5 +1,6 @@ Broker: - Fix for poor websockets performance. +- Fix lazy bridges not timing out for idle_timeout. Closes #417. Clients: - Don't use / in auto-generated client ids. diff --git a/lib/util_mosq.c b/lib/util_mosq.c index 139bea34..a80b0cbc 100644 --- a/lib/util_mosq.c +++ b/lib/util_mosq.c @@ -95,7 +95,7 @@ void _mosquitto_check_keepalive(struct mosquitto *mosq) /* Check if a lazy bridge should be timed out due to idle. */ if(mosq->bridge && mosq->bridge->start_type == bst_lazy && mosq->sock != INVALID_SOCKET - && now - mosq->next_msg_out - mosq->keepalive >= mosq->bridge->idle_timeout){ + && now - mosq->next_msg_out + mosq->keepalive >= mosq->bridge->idle_timeout){ _mosquitto_log_printf(NULL, MOSQ_LOG_NOTICE, "Bridge connection %s has exceeded idle timeout, disconnecting.", mosq->id); _mosquitto_socket_close(db, mosq);