mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-03-31 17:55:36 +00:00
ws protocol: simplify code for AnnounceAction and ScrapeAction
This commit is contained in:
parent
d94936a50b
commit
577161e540
6 changed files with 35 additions and 103 deletions
|
|
@ -775,7 +775,7 @@ impl<S: futures::AsyncRead + futures::AsyncWrite + Unpin> ConnectionReader<S> {
|
|||
|
||||
for (consumer_index, info_hashes) in info_hashes_by_worker {
|
||||
let in_message = InMessage::ScrapeRequest(ScrapeRequest {
|
||||
action: ScrapeAction,
|
||||
action: ScrapeAction::Scrape,
|
||||
info_hashes: Some(ScrapeRequestInfoHashes::Multiple(info_hashes)),
|
||||
});
|
||||
|
||||
|
|
@ -877,7 +877,7 @@ impl<S: futures::AsyncRead + futures::AsyncWrite + Unpin> ConnectionWriter<S> {
|
|||
slab.shrink_to_fit();
|
||||
|
||||
OutMessage::ScrapeResponse(ScrapeResponse {
|
||||
action: ScrapeAction,
|
||||
action: ScrapeAction::Scrape,
|
||||
files: pending.stats,
|
||||
})
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue