Chunk-piece length comparison fix (#55)
This commit is contained in:
parent
cc24623a82
commit
911bf3a0d5
4 changed files with 11 additions and 24 deletions
|
|
@ -82,9 +82,9 @@ impl Lengths {
|
|||
if !(is_power_of_two(chunk_length as u64)) {
|
||||
anyhow::bail!("chunk length {} is not a power of 2", chunk_length);
|
||||
}
|
||||
if chunk_length >= piece_length {
|
||||
if chunk_length > piece_length {
|
||||
anyhow::bail!(
|
||||
"chunk length {} should be smaller than pice length {}",
|
||||
"chunk length {} should be smaller than or equal to piece length {}",
|
||||
chunk_length,
|
||||
piece_length
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue