- } 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