From fc9a0db966ad76509af3a2bf4aba823386ec219c Mon Sep 17 00:00:00 2001 From: "Roger A. Light" Date: Thu, 2 Aug 2018 13:05:36 +0100 Subject: [PATCH] All clients now time out if they exceed their keepalive*1.5 This was inconsistent before. Partially addresses #865. --- ChangeLog.txt | 2 ++ src/loop.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index d1edaccd..f267221e 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -10,6 +10,8 @@ Broker: where only the loopback interface is defined. Closes #869, Closes #901. - Fix IPv6 addresses not being able to be used as bridge addresses. Closes #886. +- All clients now time out if they exceed their keepalive*1.5, rather than + just reach it. This was inconsistent in two places. 1.5 - 20180502 diff --git a/src/loop.c b/src/loop.c index 1c7b4d2e..6f967b60 100644 --- a/src/loop.c +++ b/src/loop.c @@ -243,7 +243,7 @@ int mosquitto_main_loop(struct mosquitto_db *db, mosq_sock_t *listensock, int li /* Local bridges never time out in this fashion. */ if(!(context->keepalive) || context->bridge - || now - context->last_msg_in < (time_t)(context->keepalive)*3/2){ + || now - context->last_msg_in <= (time_t)(context->keepalive)*3/2){ if(db__message_write(db, context) == MOSQ_ERR_SUCCESS){ #ifdef WITH_EPOLL