From 9f5543e0469396db73bdfa85358f24799cd3fb5c Mon Sep 17 00:00:00 2001 From: ifengqi <362254883@qq.com> Date: Sat, 21 Mar 2026 06:22:30 +0800 Subject: [PATCH] fix(qq): respond to WebSocket Ping frames to prevent connection timeout (#4041) The QQ channel WebSocket loop did not handle incoming Ping frames, causing the server to consider the connection dead and drop it. Add a Ping handler that replies with Pong, keeping the connection alive. Co-authored-by: Claude Opus 4.6 --- src/channels/qq.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/channels/qq.rs b/src/channels/qq.rs index 2d79e9ba5..7edf60b38 100644 --- a/src/channels/qq.rs +++ b/src/channels/qq.rs @@ -1034,6 +1034,12 @@ impl Channel for QQChannel { msg = read.next() => { let msg = match msg { Some(Ok(Message::Text(t))) => t, + Some(Ok(Message::Ping(payload))) => { + if write.send(Message::Pong(payload)).await.is_err() { + break; + } + continue; + } Some(Ok(Message::Close(_))) | None => break, _ => continue, };