Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wip: delete pieces when served when streaming #241

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
112 changes: 56 additions & 56 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions crates/dht/src/dht.rs
Original file line number Diff line number Diff line change
Expand Up @@ -402,9 +402,8 @@ impl<C: RecursiveRequestCallbacks> RecursiveRequest<C> {
self.callbacks.on_request_start(self, id, addr);
}

let response = self.dht.request(self.request.clone(), addr).await.map(|r| {
let response = self.dht.request(self.request.clone(), addr).await.inspect(|r| {
self.mark_node_responded(addr, &r);
r
});
if let Some(id) = id {
self.callbacks.on_request_end(self, id, addr, &response);
Expand Down
3 changes: 2 additions & 1 deletion crates/librqbit/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ use crate::{
peer::stats::snapshot::{PeerStatsFilter, PeerStatsSnapshot},
FileStream, ManagedTorrentHandle,
},
StreamOptions,
};

#[cfg(feature = "tracing-subscriber-utils")]
Expand Down Expand Up @@ -423,7 +424,7 @@ impl Api {

pub fn api_stream(&self, idx: TorrentIdOrHash, file_id: usize) -> Result<FileStream> {
let mgr = self.mgr_handle(idx)?;
Ok(mgr.stream(file_id)?)
Ok(mgr.stream(file_id, StreamOptions::default())?)
}
}

Expand Down
2 changes: 2 additions & 0 deletions crates/librqbit/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ pub mod session_stats;
mod spawn_utils;
pub mod storage;
mod stream_connect;
mod stream_ops;
mod torrent_state;
#[cfg(feature = "tracing-subscriber-utils")]
pub mod tracing_subscriber_config_utils;
Expand All @@ -80,6 +81,7 @@ pub use session::{
SessionPersistenceConfig, SUPPORTED_SCHEMES,
};
pub use spawn_utils::spawn as librqbit_spawn;
pub use stream_ops::StreamOptions;
pub use torrent_state::{
ManagedTorrent, ManagedTorrentShared, ManagedTorrentState, TorrentStats, TorrentStatsState,
};
Expand Down
Loading
Loading