mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-03-31 17:55:36 +00:00
aquatic_ws: handler: implement scrape handler; other small changes
This commit is contained in:
parent
1bb9caa8d1
commit
7ebbb311e1
2 changed files with 109 additions and 37 deletions
|
|
@ -1,9 +1,11 @@
|
|||
use std::net::SocketAddr;
|
||||
use std::time::Instant;
|
||||
use std::sync::Arc;
|
||||
|
||||
use flume::{Sender, Receiver};
|
||||
use hashbrown::HashMap;
|
||||
use indexmap::IndexMap;
|
||||
use parking_lot::Mutex;
|
||||
|
||||
use crate::protocol::*;
|
||||
|
||||
|
|
@ -33,14 +35,14 @@ pub type TorrentMap = HashMap<InfoHash, TorrentData>;
|
|||
|
||||
|
||||
pub struct State {
|
||||
pub torrents: TorrentMap,
|
||||
pub torrents: Arc<Mutex<TorrentMap>>,
|
||||
}
|
||||
|
||||
|
||||
impl Default for State {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
torrents: HashMap::new(),
|
||||
torrents: Arc::new(Mutex::new(HashMap::new())),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue