From dfc2df90c747ee2264297002f2c093437dacd1a6 Mon Sep 17 00:00:00 2001 From: wangjia <809946525@qq.com> Date: Fri, 19 Jun 2026 07:33:08 +0800 Subject: [PATCH] =?UTF-8?q?fix(client):=20=E8=BF=9E=E6=8E=A5=E5=90=8E?= =?UTF-8?q?=E5=BB=B6=E8=BF=9F=E6=9C=AA=E6=8E=A2=E6=B5=8B=E6=97=B6=E5=9B=9E?= =?UTF-8?q?=E9=80=80=E8=8A=82=E7=82=B9=20TCP=20=E6=8E=A2=E9=92=88(?= =?UTF-8?q?=E5=B0=BD=E9=87=8F=E4=B8=8D=E6=98=BE=E7=A4=BA=20=E2=80=94)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 连上后 urltest 头几分钟还没探过会显示 —;现回退用节点页的 TCP 探针 ping (连接前测得、~真实 RTT),urltest 出值后再切换。stats 页已有同款回退。 Co-Authored-By: Claude Opus 4.8 --- client/lib/screens/connect_page.dart | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/client/lib/screens/connect_page.dart b/client/lib/screens/connect_page.dart index f8aa63f..be1b07a 100644 --- a/client/lib/screens/connect_page.dart +++ b/client/lib/screens/connect_page.dart @@ -35,9 +35,10 @@ class ConnectPage extends ConsumerWidget { final stats = ref.watch(vpnStatsProvider).valueOrNull; final down = _speed(stats?.downloadSpeed); final up = _speed(stats?.uploadSpeed); - // 延迟来源:连接后用内核 urltest 实测(代理真实 RTT,TCP 探针被隧道吞掉时仍准); - // 未连接时用节点 TCP 探针 ping。0/无 → 显示 —。 - final livePing = conn.phase == VpnPhase.on ? _bestUrltest(stats) : node.ping; + // 延迟来源:连接后优先用内核 urltest 实测(代理真实 RTT);urltest 还没探过时 + // 回退用节点页的 TCP 探针 ping,尽量不显示 —。都没有才 —。 + var livePing = conn.phase == VpnPhase.on ? _bestUrltest(stats) : node.ping; + if (livePing <= 0) livePing = node.ping; final pingLabel = livePing > 0 ? '${livePing}ms' : '—'; final latencyValue = livePing > 0 ? '$livePing' : '—';