From a1e2d7c76228ef99a55d0aaed5b642bf5e596e27 Mon Sep 17 00:00:00 2001 From: pjh456 <147148383@qq.com> Date: Thu, 8 Oct 2026 01:55:49 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=AF=BB=E5=B8=A7=E9=81=87=E4=BF=A1?= =?UTF-8?q?=E5=8F=B7=E4=B8=AD=E6=96=AD=E9=87=8D=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Cargo.toml | 2 +- crates/oxide_cli/src/server/protocol.rs | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 4c433a56..b44fc330 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,7 +22,7 @@ members = [ ] [workspace.package] -version = "0.8.56" +version = "0.8.57" edition = "2021" license = "MIT" rust-version = "1.80" diff --git a/crates/oxide_cli/src/server/protocol.rs b/crates/oxide_cli/src/server/protocol.rs index 595584f9..a84e680f 100644 --- a/crates/oxide_cli/src/server/protocol.rs +++ b/crates/oxide_cli/src/server/protocol.rs @@ -350,8 +350,13 @@ impl FrameReader { } // 从流读一块追加到余量缓冲。 + // 信号中断(EINTR)不视为错误:重试读,保持读循环不变式。 let mut chunk = [0u8; 4096]; - let n = self.inner.read(&mut chunk)?; + let n = match self.inner.read(&mut chunk) { + Ok(n) => n, + Err(e) if e.kind() == std::io::ErrorKind::Interrupted => continue, + Err(e) => return Err(e), + }; if n == 0 { // EOF:余量缓冲的残行原样交付(可能为空)。 let line = std::mem::take(&mut self.pending);