mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-04-01 02:05:30 +00:00
aquatic_ws: add more protocol fixes and info; small handler fix
This commit is contained in:
parent
b2b4f5bb89
commit
1bb9caa8d1
2 changed files with 69 additions and 44 deletions
|
|
@ -32,15 +32,27 @@ pub fn run_request_worker(
|
|||
};
|
||||
}
|
||||
|
||||
// TODO: lock torrent mutex
|
||||
|
||||
// This should be separate function. Possibly requests should be separated
|
||||
// above and one announce and one scrape handler used
|
||||
for (meta, in_message) in in_messages.drain(..){
|
||||
// announce requests:
|
||||
// if offers are set, fetch same number of peers, send offers to all of them
|
||||
// if answer is set, fetch that peer, send answer to it
|
||||
// finally, return announce response, seemingly
|
||||
|
||||
// scrape: just fetch stats for all info_hashes sent
|
||||
|
||||
let out_message = OutMessage::ScrapeResponse(ScrapeResponse {
|
||||
files: HashMap::new(),
|
||||
flags: HashMap::new(),
|
||||
});
|
||||
|
||||
out_messages.push((meta, out_message));
|
||||
}
|
||||
|
||||
// TODO: unlock torrent mutex
|
||||
|
||||
for (meta, out_message) in out_messages.drain(..){
|
||||
out_message_sender.send(meta, out_message);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue