Problem with client-side PING

TCP logs:
ZNC sends

PING 1733847626047\r\n

IRCd sends

:swee.codes PONG swee.codes :1733847626047\r\n

ZNC sends

PING 1733847626047\r\n

IRCd sends

:swee.codes PONG swee.codes :1733847626047\r\n

ZNC sends

PING 1733847626047\r\n

IRCd sends

:swee.codes PONG swee.codes :1733847626047\r\n

A few seconds later, ZNC sends

PING 1733847626047\r\nPING 1733847626047\r\nPING 1733847626047\r\nPING 1733847626047\r\nPING 1733847626047\r\nPING 1733847626047\r\n

IRCd sends

:swee.codes PONG swee.codes :1733847626047\r\n
:swee.codes PONG swee.codes :1733847626047\r\n
:swee.codes PONG swee.codes :1733847626047\r\n
:swee.codes PONG swee.codes :1733847626047\r\n
:swee.codes PONG swee.codes :1733847626047\r\n
:swee.codes PONG swee.codes :1733847626047\r\n

All lines in different send() functions
A few mins while spam pinging, ZNC quits.

<*status> Disconnected from IRC. Reconnecting...
<*status> Connected!

How to fix? Did I do something wrong with server PONG?

Apparently, Client-side PING wasn’t the issue, the server marks the client as “ping pending” AFTER PINGING, so the client sends PONG before it was marked.

The spam pinging is normal ZNC behavior it seems.

I have fixed this problem, thank you all (people from IRC) for the support, and sorry for the misunderstanding. :,3

Commits that fixed the problem: