mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-04-01 18:25:30 +00:00
udp: split AnnounceResponse into V4 and V6 versions
This commit is contained in:
parent
4b07e007f3
commit
f3e41148fe
9 changed files with 255 additions and 119 deletions
|
|
@ -165,7 +165,14 @@ fn process_response(
|
|||
|
||||
Some(request)
|
||||
}
|
||||
Response::Announce(r) => if_torrent_peer_move_and_create_random_request(
|
||||
Response::AnnounceIpv4(r) => if_torrent_peer_move_and_create_random_request(
|
||||
config,
|
||||
rng,
|
||||
info_hashes,
|
||||
torrent_peers,
|
||||
r.transaction_id,
|
||||
),
|
||||
Response::AnnounceIpv6(r) => if_torrent_peer_move_and_create_random_request(
|
||||
config,
|
||||
rng,
|
||||
info_hashes,
|
||||
|
|
|
|||
|
|
@ -129,7 +129,11 @@ fn read_responses(
|
|||
match Response::from_bytes(&buffer[0..amt]) {
|
||||
Ok(response) => {
|
||||
match response {
|
||||
Response::Announce(ref r) => {
|
||||
Response::AnnounceIpv4(ref r) => {
|
||||
ls.responses_announce += 1;
|
||||
ls.response_peers += r.peers.len();
|
||||
}
|
||||
Response::AnnounceIpv6(ref r) => {
|
||||
ls.responses_announce += 1;
|
||||
ls.response_peers += r.peers.len();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue