From fe69855dc9d8e99f2196bfd8f1381e577bab1eb7 Mon Sep 17 00:00:00 2001 From: wangfq Date: Fri, 3 Jul 2026 15:18:54 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20Auth=20timeout=20=E8=80=97=E5=B0=BD?= =?UTF-8?q?=E9=87=8D=E5=90=AF=E9=99=90=E9=A2=9D=E5=AF=BC=E8=87=B4=E5=86=B7?= =?UTF-8?q?=E5=8D=B4=E6=9C=9F=E9=98=BB=E6=96=AD=E8=BF=9E=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 根因: auth timeout(60s) 走 do_restart 计数, 上电后 4 分钟就耗尽 3 次限额, 进入 10min 冷却期, 客户端无法连接. 修复: auth timeout 直接调 tcp_json_restart() 绕开 do_restart, 不消耗重启计数器. 只保留 5min 空闲/无连接作为限额保护目标. --- vd960DBN/BLE/OnlyUpdateApp_Peripheral/APP/tcp_json_srv.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/vd960DBN/BLE/OnlyUpdateApp_Peripheral/APP/tcp_json_srv.c b/vd960DBN/BLE/OnlyUpdateApp_Peripheral/APP/tcp_json_srv.c index 87160f5..4a9bb62 100644 --- a/vd960DBN/BLE/OnlyUpdateApp_Peripheral/APP/tcp_json_srv.c +++ b/vd960DBN/BLE/OnlyUpdateApp_Peripheral/APP/tcp_json_srv.c @@ -1210,11 +1210,12 @@ void tcp_json_poll(void) { goto do_restart; } - // Auth timeout — 60s 未完成鉴权 → 重启网络接口 + // Auth timeout — 60s 未完成鉴权 → 重启网络接口 (不计数, 正常运维行为) if (g_json_auth_state == JSON_STATE_WAIT_AUTH) { if (mstick() - g_json_auth_timer > TCP_JSON_AUTH_TIMEOUT_MS) { - PRINT("JSON: Auth timeout → restart\n"); - goto do_restart; + PRINT("JSON: Auth timeout → restart (no count)\n"); + tcp_json_restart(); + return; } }