mirror of
https://github.com/osmarks/ngircd.git
synced 2024-12-12 09:50:29 +00:00
Enhance debug logging for PONG commands
Distinguish between expected and unexpected PONG commands.
This commit is contained in:
parent
dc6807338e
commit
430bb22376
@ -877,9 +877,17 @@ IRC_PONG(CLIENT *Client, REQUEST *Req)
|
||||
(long)(time(NULL) - Conn_GetSignon(conn)),
|
||||
time(NULL) - Conn_GetSignon(conn) == 1 ? "" : "s",
|
||||
Client_UserCount(), Channel_CountVisible(NULL));
|
||||
} else
|
||||
LogDebug("Connection %d: received PONG. Lag: %ld seconds.",
|
||||
conn, (long)(time(NULL) - Conn_LastPing(conn)));
|
||||
}
|
||||
#ifdef DEBUG
|
||||
else {
|
||||
if (Conn_LastPing(conn) > 1)
|
||||
LogDebug("Connection %d: received PONG. Lag: %ld seconds.",
|
||||
conn, (long)(time(NULL) - Conn_LastPing(conn)));
|
||||
else
|
||||
LogDebug("Got unexpected PONG on connection %d. Ignored.",
|
||||
conn);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* We got a PONG, so signal that none is pending on this connection. */
|
||||
Conn_UpdatePing(conn, 1);
|
||||
|
Loading…
Reference in New Issue
Block a user