Fixed overflow
This commit is contained in:
parent
789bfca745
commit
72a97e296b
@ -656,11 +656,13 @@ async fn recv<T: AsyncRead>(
|
|||||||
let len = new_lines.len();
|
let len = new_lines.len();
|
||||||
|
|
||||||
for (index, line) in new_lines.into_iter().enumerate() {
|
for (index, line) in new_lines.into_iter().enumerate() {
|
||||||
if index == len - 1 && &buf[buf.len() - 3..] != b"\r\n" {
|
if index == len - 1 && &buf[buf.len() - 2..] != b"\r\n" {
|
||||||
*partial_line = line.to_owned();
|
*partial_line = line.to_owned();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
if line.len() != 0 {
|
||||||
lines.push(line.to_owned());
|
lines.push(line.to_owned());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
Ok(lines)
|
Ok(lines)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user