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
|
|
@ -58,7 +58,7 @@ fn create_announce_request(
|
|||
}
|
||||
|
||||
InMessage::AnnounceRequest(AnnounceRequest {
|
||||
action: AnnounceAction,
|
||||
action: AnnounceAction::Announce,
|
||||
info_hash: state.info_hashes[info_hash_index],
|
||||
peer_id,
|
||||
bytes_left: Some(bytes_left),
|
||||
|
|
@ -82,7 +82,7 @@ fn create_scrape_request(config: &Config, state: &LoadTestState, rng: &mut impl
|
|||
}
|
||||
|
||||
InMessage::ScrapeRequest(ScrapeRequest {
|
||||
action: ScrapeAction,
|
||||
action: ScrapeAction::Scrape,
|
||||
info_hashes: Some(ScrapeRequestInfoHashes::Multiple(scrape_hashes)),
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue