mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-04-02 02:35:31 +00:00
udp: use slab for pending scrape responses to fix potential issue
Peers sometimes send multiple scrape requests with the same transaction id, which would previously cause warnings due to replacing the PendingScrapeMapEntry and later not finding it.
This commit is contained in:
parent
700dd68d2c
commit
00c4e74374
4 changed files with 39 additions and 62 deletions
|
|
@ -31,15 +31,13 @@ impl Ip for Ipv6Addr {
|
|||
|
||||
#[derive(Debug)]
|
||||
pub struct PendingScrapeRequest {
|
||||
pub connection_id: ConnectionId,
|
||||
pub transaction_id: TransactionId,
|
||||
pub slab_key: usize,
|
||||
pub info_hashes: BTreeMap<usize, InfoHash>,
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct PendingScrapeResponse {
|
||||
pub connection_id: ConnectionId,
|
||||
pub transaction_id: TransactionId,
|
||||
pub slab_key: usize,
|
||||
pub torrent_stats: BTreeMap<usize, TorrentScrapeStatistics>,
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue