From: Alexander Barton Date: Sun, 3 May 2020 01:04:29 +0000 (+0200) Subject: Set the "last data" time to "last ping" time when updating the latter X-Git-Tag: rel-26-rc1~22 X-Git-Url: https://arthur.barton.de/gitweb/?p=ngircd.git;a=commitdiff_plain;h=79a917f954bef8089967786bd3597a6e5ff5c336;hp=42e8654d7b04197eb90ce1ccd8a055ffb6309c3d Set the "last data" time to "last ping" time when updating the latter This is required because the PING can be received quite a bit earlier than it is actually handled, for example during "server burst" or other heavy operations: So the times won't match and PING-PONG logic would become garbled, because we test for "last ping > last data" to determine if a PING already was sent or not. --- diff --git a/src/ngircd/conn-func.c b/src/ngircd/conn-func.c index 72d38b86..4a2d32d6 100644 --- a/src/ngircd/conn-func.c +++ b/src/ngircd/conn-func.c @@ -51,7 +51,7 @@ GLOBAL void Conn_UpdatePing(CONN_ID Idx) { assert(Idx > NONE); - My_Connections[Idx].lastping = time(NULL); + My_Connections[Idx].lastping = My_Connections[Idx].lastdata = time(NULL); } /*