mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-04-01 10:15:31 +00:00
aquatic_ws: rewrite failing serialization, add tests
Use different approach to action fields and info_hash vec, fixing failing tests
This commit is contained in:
parent
c8512e1cdf
commit
0637f83daa
5 changed files with 311 additions and 250 deletions
|
|
@ -80,6 +80,7 @@ fn create_announce_request(
|
|||
.copy_from_slice(&connection_id.to_ne_bytes());
|
||||
|
||||
InMessage::AnnounceRequest(AnnounceRequest {
|
||||
action: AnnounceAction,
|
||||
info_hash: state.info_hashes[info_hash_index],
|
||||
peer_id,
|
||||
bytes_left: Some(bytes_left),
|
||||
|
|
@ -108,7 +109,8 @@ fn create_scrape_request(
|
|||
}
|
||||
|
||||
InMessage::ScrapeRequest(ScrapeRequest {
|
||||
info_hashes: scrape_hashes,
|
||||
action: ScrapeAction,
|
||||
info_hashes: Some(ScrapeRequestInfoHashes::Multiple(scrape_hashes)),
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue