mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-04-01 02:05:30 +00:00
ws: remove peer from all torrent maps when connection is closed
This commit is contained in:
parent
b30da1a930
commit
720ceacf99
5 changed files with 134 additions and 17 deletions
|
|
@ -4,6 +4,7 @@ use aquatic_common::access_list::AccessListArcSwap;
|
|||
use aquatic_common::CanonicalSocketAddr;
|
||||
|
||||
pub use aquatic_common::ValidUntil;
|
||||
use aquatic_ws_protocol::{InfoHash, PeerId};
|
||||
|
||||
#[derive(Default, Clone)]
|
||||
pub struct State {
|
||||
|
|
@ -28,3 +29,12 @@ pub struct ConnectionMeta {
|
|||
pub peer_addr: CanonicalSocketAddr,
|
||||
pub pending_scrape_id: Option<PendingScrapeId>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug)]
|
||||
pub enum SwarmControlMessage {
|
||||
ConnectionClosed {
|
||||
info_hash: InfoHash,
|
||||
peer_id: PeerId,
|
||||
peer_addr: CanonicalSocketAddr,
|
||||
},
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue