Skip to content

Commit

Permalink
fix after rebase on remove-reopen
Browse files Browse the repository at this point in the history
  • Loading branch information
ikatson committed Apr 30, 2024
1 parent 4a73739 commit 5cac8ac
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
4 changes: 4 additions & 0 deletions crates/librqbit/src/chunk_tracker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,10 @@ impl ChunkTracker {
self.hns = res;
Ok(res)
}

pub(crate) fn get_selected_pieces(&self) -> &BF {
&self.selected
}
}

#[cfg(test)]
Expand Down
10 changes: 1 addition & 9 deletions crates/librqbit/src/torrent_state/streaming.rs
Original file line number Diff line number Diff line change
Expand Up @@ -351,15 +351,7 @@ impl ManagedTorrent {
file_torrent_abs_offset: fd_offset,
torrent: self,
};
if s.torrent.maybe_reconnect_needed_peers_for_file(file_id) {
// TODO: get rid of reopening files, it's such a source of bugs and complexity
s.torrent.with_opened_files(|files| {
for file in files {
file.reopen(false)?;
}
Ok::<_, anyhow::Error>(())
})??;
}
s.torrent.maybe_reconnect_needed_peers_for_file(file_id);
streams.streams.insert(
s.stream_id,
StreamState {
Expand Down

0 comments on commit 5cac8ac

Please sign in to comment.