Pass back peers from Web UI when adding a magnet in attempt to speed it up

This commit is contained in:
Igor Katson 2023-12-01 09:30:23 +00:00
parent 21b1bd9e7d
commit f337ab1837
No known key found for this signature in database
GPG key ID: B4EC22B66D61A3F5
8 changed files with 77 additions and 27 deletions

View file

@ -192,7 +192,7 @@ pub struct AddTorrentOptions {
pub sub_folder: Option<String>,
pub peer_opts: Option<PeerConnectionOptions>,
pub force_tracker_interval: Option<Duration>,
pub initial_peers: Option<Vec<SocketAddr>>,
// This is used to restore the session.
pub preferred_id: Option<usize>,
}
@ -201,6 +201,7 @@ pub struct ListOnlyResponse {
pub info_hash: Id20,
pub info: TorrentMetaV1Info<ByteString>,
pub only_files: Option<Vec<usize>>,
pub seen_peers: Vec<SocketAddr>,
}
pub enum AddTorrentResponse {
@ -642,6 +643,7 @@ impl Session {
info_hash,
info,
only_files,
seen_peers: initial_peers,
}));
}