fix: Auth timeout 耗尽重启限额导致冷却期阻断连接

根因: auth timeout(60s) 走 do_restart 计数, 上电后 4 分钟就耗尽 3 次限额,
      进入 10min 冷却期, 客户端无法连接.

修复: auth timeout 直接调 tcp_json_restart() 绕开 do_restart,
      不消耗重启计数器. 只保留 5min 空闲/无连接作为限额保护目标.
This commit is contained in:
wangfq
2026-07-03 15:18:54 +08:00
parent d7951b1056
commit fe69855dc9
@@ -1210,11 +1210,12 @@ void tcp_json_poll(void) {
goto do_restart; goto do_restart;
} }
// Auth timeout — 60s 未完成鉴权 → 重启网络接口 // Auth timeout — 60s 未完成鉴权 → 重启网络接口 (不计数, 正常运维行为)
if (g_json_auth_state == JSON_STATE_WAIT_AUTH) { if (g_json_auth_state == JSON_STATE_WAIT_AUTH) {
if (mstick() - g_json_auth_timer > TCP_JSON_AUTH_TIMEOUT_MS) { if (mstick() - g_json_auth_timer > TCP_JSON_AUTH_TIMEOUT_MS) {
PRINT("JSON: Auth timeout → restart\n"); PRINT("JSON: Auth timeout → restart (no count)\n");
goto do_restart; tcp_json_restart();
return;
} }
} }