Skip to content

Commit

Permalink
refactor: Improve readability and maintainability of auto_proxy_strea…
Browse files Browse the repository at this point in the history
…m.rs
  • Loading branch information
arloor committed Sep 5, 2024
1 parent 6b7ecd9 commit ce15f02
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -356,11 +356,12 @@ async fn wait_response(tls_stream: &mut tokio_rustls::client::TlsStream<MonProxy
loop {
// 从流中读取数据
match tls_stream.read(&mut buf).await {
Ok(0) => {
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];
Expand Down

0 comments on commit ce15f02

Please sign in to comment.