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);