mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-04-02 02:35:31 +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
|
|
@ -5,6 +5,7 @@ use common::*;
|
|||
use std::{
|
||||
io::{Cursor, ErrorKind},
|
||||
net::{Ipv4Addr, SocketAddr, SocketAddrV4, UdpSocket},
|
||||
num::NonZeroU16,
|
||||
time::Duration,
|
||||
};
|
||||
|
||||
|
|
@ -51,7 +52,7 @@ fn test_invalid_connection_id() -> anyhow::Result<()> {
|
|||
ip_address: Ipv4AddrBytes([0; 4]),
|
||||
key: PeerKey::new(0),
|
||||
peers_wanted: NumberOfPeers::new(10),
|
||||
port: Port::new(1),
|
||||
port: Port::new(NonZeroU16::new(1).unwrap()),
|
||||
});
|
||||
|
||||
let scrape_request = Request::Scrape(ScrapeRequest {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue