mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-04-01 18:25:30 +00:00
udp: consistently use NonZeroU16 for announce request port
This commit is contained in:
parent
b4e27903dc
commit
3513b714b4
8 changed files with 18 additions and 14 deletions
|
|
@ -1,6 +1,5 @@
|
|||
use std::io::Cursor;
|
||||
use std::net::SocketAddr;
|
||||
use std::num::NonZeroU16;
|
||||
use std::sync::atomic::Ordering;
|
||||
use std::time::Duration;
|
||||
|
||||
|
|
@ -193,7 +192,7 @@ impl Worker {
|
|||
scrape_hash_indices,
|
||||
connection_id,
|
||||
peer_id: generate_peer_id(),
|
||||
port: Port::new(self.rng.gen::<NonZeroU16>().into()),
|
||||
port: Port::new(self.rng.gen()),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue