diff --git a/src/http1.rs b/src/http1.rs index 6bb37ea6..aae0f664 100644 --- a/src/http1.rs +++ b/src/http1.rs @@ -4756,6 +4756,20 @@ mod tests { rbuf_position: 3, dest_data: "hel", }, + Test { + name: "known-partial-end", + data: "hel", + end: true, + body_size: BodySize::Known(5), + chunk_left: Some(5), + chunk_size: 0, + chunked: false, + result: Err(io::Error::from(io::ErrorKind::UnexpectedEof).into()), + chunk_left_after: Some(5), + chunk_size_after: 0, + rbuf_position: 0, + dest_data: "", + }, Test { name: "known-complete", data: "hello", @@ -4812,6 +4826,20 @@ mod tests { rbuf_position: 0, dest_data: "", }, + Test { + name: "chunked-header-partial-end", + data: "5", + end: true, + body_size: BodySize::Unknown, + chunk_left: None, + chunk_size: 0, + chunked: true, + result: Err(io::Error::from(io::ErrorKind::UnexpectedEof).into()), + chunk_left_after: None, + chunk_size_after: 0, + rbuf_position: 0, + dest_data: "", + }, Test { name: "chunked-header-parse-error", data: "z", @@ -4868,6 +4896,20 @@ mod tests { rbuf_position: 6, dest_data: "hel", }, + Test { + name: "chunked-content-partial-end", + data: "5\r\nhel", + end: true, + body_size: BodySize::Unknown, + chunk_left: None, + chunk_size: 0, + chunked: true, + result: Err(io::Error::from(io::ErrorKind::UnexpectedEof).into()), + chunk_left_after: Some(2), + chunk_size_after: 5, + rbuf_position: 6, + dest_data: "hel", + }, Test { name: "chunked-footer-partial-full-none", data: "5\r\nhello", @@ -4882,6 +4924,20 @@ mod tests { rbuf_position: 8, dest_data: "hello", }, + Test { + name: "chunked-footer-partial-full-none-end", + data: "5\r\nhello", + end: true, + body_size: BodySize::Unknown, + chunk_left: None, + chunk_size: 0, + chunked: true, + result: Err(io::Error::from(io::ErrorKind::UnexpectedEof).into()), + chunk_left_after: Some(0), + chunk_size_after: 5, + rbuf_position: 8, + dest_data: "hello", + }, Test { name: "chunked-footer-partial-full-r", data: "5\r\nhello\r", @@ -4994,6 +5050,20 @@ mod tests { rbuf_position: 3, dest_data: "", }, + Test { + name: "trailing-headers-partial-end", + data: "0\r\nhelloXX", + end: true, + body_size: BodySize::Unknown, + chunk_left: None, + chunk_size: 0, + chunked: true, + result: Err(io::Error::from(io::ErrorKind::UnexpectedEof).into()), + chunk_left_after: Some(0), + chunk_size_after: 0, + rbuf_position: 3, + dest_data: "", + }, Test { name: "trailing-headers-parse-error", data: "0\r\nhelloXX\n",