Streaming test

This commit is contained in:
Igor Katson 2024-04-24 18:58:30 +01:00
parent 10974888fa
commit d1c6a5b584
5 changed files with 24 additions and 13 deletions

View file

@ -104,6 +104,7 @@ use self::{
use super::{
paused::TorrentStatePaused,
streaming::TorrentStreams,
utils::{timeit, TimedExistence},
ManagedTorrentInfo,
};
@ -174,6 +175,8 @@ pub struct TorrentStateLive {
down_speed_estimator: SpeedEstimator,
up_speed_estimator: SpeedEstimator,
cancellation_token: CancellationToken,
pub(crate) streams: Arc<TorrentStreams>,
}
impl TorrentStateLive {
@ -219,6 +222,7 @@ impl TorrentStateLive {
down_speed_estimator,
up_speed_estimator,
cancellation_token,
streams: paused.streams,
});
state.spawn(
@ -647,6 +651,7 @@ impl TorrentStateLive {
info: self.meta.clone(),
files,
chunk_tracker,
streams: self.streams.clone(),
})
}
@ -692,6 +697,8 @@ impl TorrentStateLive {
}
}
self.streams.wake_streams_on_piece_completed(id);
if self.is_finished() {
info!("torrent finished downloading");
self.finished_notify.notify_waiters();