diff --git a/crates/shadowsocks-service/src/local/net/tcp/auto_proxy_stream.rs b/crates/shadowsocks-service/src/local/net/tcp/auto_proxy_stream.rs index 67b9c52b62d5..c7454cee19dd 100644 --- a/crates/shadowsocks-service/src/local/net/tcp/auto_proxy_stream.rs +++ b/crates/shadowsocks-service/src/local/net/tcp/auto_proxy_stream.rs @@ -356,11 +356,12 @@ async fn wait_response(tls_stream: &mut tokio_rustls::client::TlsStream { + return Err(io::Error::new(io::ErrorKind::UnexpectedEof, "unexpected EOF")); + } Ok(n) => { - if n != 0 { - // 将读取到的数据追加到动态缓冲区 - buffer.put(&buf[0..n]); - } + // 将读取到的数据追加到动态缓冲区 + buffer.put(&buf[0..n]); // 尝试解析累积的数据 let mut headers = [httparse::EMPTY_HEADER; 400];