fix: listen socket CONNECT 不应触发 accepted 客户端逻辑

- WCHNET_HandleSockInt 第二路由条件增加 socketid!=g_json_socket_listen
- tcp_json_handle_sock_int 'Newly accepted' 检查增加 socketid!=g_json_socket_listen
- 防止 listen socket 的 CONNECT 事件误触发 WCHNET_ModifyRecvBuf 和 g_json_socket_client 覆写

根因:TCP_LISTEN socket 和 accepted client 是不同 socket ID(1 vs 3),
listen socket 的 CONNECT 不应穿透到 'newly accepted' 分支去配置 recv buffer,
否则会干扰 WCHNET 对 accepted socket 的数据路由
This commit is contained in:
wangfq
2026-07-01 09:52:28 +08:00
parent be8c48688c
commit 7804d97a45
2 changed files with 6 additions and 3 deletions

View File

@@ -662,8 +662,9 @@ void tcp_json_handle_sock_int(uint8_t socketid, uint8_t intstat) {
}
}
// === Newly accepted client (CONNECT on unknown socket) ===
// === Newly accepted client (CONNECT on unknown socket, but NOT the listen socket) ===
if ((intstat & SINT_STAT_CONNECT) && socketid != g_json_socket_client
&& socketid != g_json_socket_listen
&& socketid != SocketId_TCP && socketid != SocketId_UDP) {
g_json_socket_client = socketid;
g_json_auth_state = JSON_STATE_WAIT_AUTH;