This commit is contained in:
wrk 2023-06-09 02:10:42 +02:00
parent 72a97e296b
commit 14682b4481
1 changed files with 5 additions and 2 deletions

View File

@ -651,8 +651,11 @@ async fn recv<T: AsyncRead>(
let buf = &buf[..bytes_read];
*partial_line += String::from_utf8_lossy(buf).into_owned().as_str();
let new_lines: Vec<&str> = partial_line.split("\r\n").collect();
let buf_str: String =
partial_line.to_owned() + String::from_utf8_lossy(buf).into_owned().as_str();
*partial_line = String::new();
let new_lines: Vec<&str> = buf_str.split("\r\n").collect();
let len = new_lines.len();
for (index, line) in new_lines.into_iter().enumerate() {