Skip to content

Commit

Permalink
feat: remove content length is zero log and range length is zero log (#…
Browse files Browse the repository at this point in the history
…176)

Signed-off-by: Gaius <[email protected]>
  • Loading branch information
gaius-qi authored Dec 27, 2023
1 parent c8c35e2 commit 8a2b028
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/task/piece.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,14 +123,12 @@ impl Piece {
) -> Result<Vec<metadata::Piece>> {
// If content_length is 0, return empty piece.
if content_length == 0 {
info!("content length is 0");
return Ok(Vec::new());
}

// If range is not None, calculate the pieces by range.
if let Some(range) = range {
if range.length == 0 {
info!("range length is 0");
return Err(Error::InvalidParameter());
}

Expand Down

0 comments on commit 8a2b028

Please sign in to comment.