Skip to content

Commit

Permalink
wip: add max memory size
Browse files Browse the repository at this point in the history
  • Loading branch information
LIAUD Corentin committed Oct 5, 2024
1 parent a8bdc5f commit 0734368
Show file tree
Hide file tree
Showing 17 changed files with 281 additions and 107 deletions.
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

0 comments on commit 0734368

Please sign in to comment.