udp: consistently use NonZeroU16 for announce request port

This commit is contained in:
Joakim Frostegård 2024-02-03 11:46:38 +01:00
parent b4e27903dc
commit 3513b714b4
8 changed files with 18 additions and 14 deletions

View file

@ -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()),
}
}