Something horribly broken. But added downloading

This commit is contained in:
Igor Katson 2021-06-26 00:32:52 +01:00
parent 0a640daba4
commit e1354e8a85
5 changed files with 160 additions and 28 deletions

View file

@ -55,7 +55,7 @@ impl ChunkTracker {
// return true if the whole piece is marked downloaded
pub fn mark_chunk_downloaded(&mut self, piece: &Piece<ByteString>) -> Option<bool> {
let chunk_info = self.lengths.chunk_info_from_received_piece_data(piece)?;
let chunk_info = self.lengths.chunk_info_from_received_piece(piece)?;
self.chunk_status
.set(chunk_info.absolute_index as usize, true);
let chunk_range = self.lengths.chunk_range(chunk_info.piece_index);