summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/common/hexchat.c2
-rw-r--r--src/fe-gtk/fe-gtk.c4
2 files changed, 5 insertions, 1 deletions
diff --git a/src/common/hexchat.c b/src/common/hexchat.c
index aa18911e..4bea0742 100644
--- a/src/common/hexchat.c
+++ b/src/common/hexchat.c
@@ -281,7 +281,7 @@ lag_check (void)
 								 NULL, NULL, 0);
 				if (prefs.hex_net_auto_reconnect)
 					serv->auto_reconnect (serv, FALSE, -1);
-			} else
+			} else if (!serv->lag_sent)
 			{
 				snprintf (tbuf, sizeof (tbuf), "LAG%lu", tim);
 				serv->p_ping (serv, "", tbuf);
diff --git a/src/fe-gtk/fe-gtk.c b/src/fe-gtk/fe-gtk.c
index deefb788..d87ccd4e 100644
--- a/src/fe-gtk/fe-gtk.c
+++ b/src/fe-gtk/fe-gtk.c
@@ -735,6 +735,10 @@ fe_set_lag (server *serv, int lag)
 		lag = (nowtim - serv->lag_sent) / 100000;
 	}
 
+	/* if there is no pong for >30s report the lag as +30s */
+	if (lag > 300 && serv->lag_sent)
+		lag=300;
+
 	per = (double)((double)lag / (double)10);
 	if (per > 1.0)
 		per = 1.0;