]> arthur.barton.de Git - ngircd-alex.git/commit
Fix PING-PONG handling when processing backlog in read buffers
authorAlexander Barton <alex@barton.de>
Mon, 25 May 2020 17:02:16 +0000 (19:02 +0200)
committerAlexander Barton <alex@barton.de>
Mon, 25 May 2020 20:59:58 +0000 (22:59 +0200)
commitdc6807338e240d8093f43337dab7bfe488c35c4a
tree286dc7302f652af2877eb34e973c6716a2e58269
parent0d503945cb527e275ef6644a234a6876ff61322b
Fix PING-PONG handling when processing backlog in read buffers

Prior to this commit, the PONG wasn't registered correctly, becauuse the
"last ping" time was set to time(NULL), which could be bigger than the
"last data" time stamp, for example when handling the read buffer took
more than 1 second -- and this resulted in the PONG time out kicking in
effectively disconnecting a newly linked server for example, because
ngIRCd thought it was still waiting for a PONG: last data < last ping.

Now the "last ping" value has three possible values:

    0: new connection, no PING, no PONG so far.
    1: got a PONG, no longer waiting for a PONG.
  <t>: time stamp of last sent out PING command.
src/ngircd/conn-func.c
src/ngircd/conn-func.h
src/ngircd/conn.c
src/ngircd/irc-login.c