Store torrent bytes

This commit is contained in:
Igor Katson 2024-08-12 23:24:11 +01:00
parent 5740d3ebe9
commit 41a2cd58b3
No known key found for this signature in database
GPG key ID: B4EC22B66D61A3F5
4 changed files with 46 additions and 23 deletions

View file

@ -16,6 +16,7 @@ use librqbit_core::hash_id::Id20;
pub enum ReadMetainfoResult<Rx> {
Found {
info: TorrentMetaV1Info<ByteBufOwned>,
bytes: ByteBufOwned,
rx: Rx,
seen: HashSet<SocketAddr>,
},
@ -80,7 +81,7 @@ pub async fn read_metainfo_from_peer_receiver<A: Stream<Item = SocketAddr> + Unp
},
done = unordered.next(), if !unordered.is_empty() => {
match done {
Some(Ok(info)) => return ReadMetainfoResult::Found { info, seen, rx: addrs },
Some(Ok(info)) => return ReadMetainfoResult::Found { info: info.0, bytes: info.1, seen, rx: addrs },
Some(Err(e)) => {
debug!("{:#}", e);
},