From b7c82d791010bd4c9b45528846f95b9886e9f984 Mon Sep 17 00:00:00 2001 From: alexhultman-2fa <58995996+alexhultman-2fa@users.noreply.github.com> Date: Tue, 13 Apr 2021 14:19:05 +0200 Subject: [PATCH] Fix calculateIdleTimeoutCompnents --- src/WebSocketContextData.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/WebSocketContextData.h b/src/WebSocketContextData.h index 1449bf4..4cac0da 100644 --- a/src/WebSocketContextData.h +++ b/src/WebSocketContextData.h @@ -83,7 +83,7 @@ public: unsigned short margin = 4; /* 4, 8 or 16 seconds margin based on idleTimeout */ while ((int) idleTimeout - margin * 2 >= margin * 2 && margin < 16) { - margin = (unsigned short) (margin << 2); + margin = (unsigned short) (margin << 1); } /* We should have no margin if not using sendPingsAutomatically */ if (!sendPingsAutomatically) {