mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-04-02 18:55:32 +00:00
aquatic_ws: announce handler fixes, related changes elsewhere
This commit is contained in:
parent
7ebbb311e1
commit
a39c7a5950
3 changed files with 55 additions and 8 deletions
|
|
@ -14,7 +14,7 @@ pub struct ValidUntil(pub Instant);
|
|||
|
||||
|
||||
pub struct Peer {
|
||||
pub peer_id: PeerId,
|
||||
pub peer_id: PeerId, // FIXME: maybe this field can be removed
|
||||
pub complete: bool,
|
||||
pub valid_until: ValidUntil,
|
||||
pub connection_meta: ConnectionMeta,
|
||||
|
|
@ -31,6 +31,17 @@ pub struct TorrentData {
|
|||
}
|
||||
|
||||
|
||||
impl Default for TorrentData {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
peers: IndexMap::new(),
|
||||
seeders: 0,
|
||||
leechers: 0,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
pub type TorrentMap = HashMap<InfoHash, TorrentData>;
|
||||
|
||||
|
||||
|
|
@ -48,6 +59,7 @@ impl Default for State {
|
|||
}
|
||||
|
||||
|
||||
#[derive(Clone, Copy)]
|
||||
pub struct ConnectionMeta {
|
||||
/// Index of socket worker responsible for this connection. Required for
|
||||
/// sending back response through correct channel to correct worker.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue