diff --git a/src/lib.rs b/src/lib.rs index 0331da1..4770ef9 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -656,11 +656,13 @@ async fn recv( let len = new_lines.len(); 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(); break; } - lines.push(line.to_owned()); + if line.len() != 0 { + lines.push(line.to_owned()); + } } Ok(lines) }