Skip to content

Commit

Permalink
fixup! fixup! Add a torrent announce subcommand
Browse files Browse the repository at this point in the history
minimize magic ip addresses
  • Loading branch information
atomgardner committed Feb 11, 2023
1 parent 8068126 commit cc7d2d6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ pub(crate) use std::{
hash::Hash,
io::{self, BufRead, BufReader, Cursor, Read, Write},
iter::{self, Sum},
net::{IpAddr, SocketAddr, ToSocketAddrs, UdpSocket},
net::{IpAddr, Ipv4Addr, Ipv6Addr, SocketAddr, ToSocketAddrs, UdpSocket},
num::{ParseFloatError, ParseIntError, TryFromIntError},
ops::{AddAssign, Div, DivAssign, Mul, MulAssign, Sub, SubAssign},
path::{self, Path, PathBuf},
Expand Down
4 changes: 2 additions & 2 deletions src/tracker/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ impl<'a> Client {
sock = match addr {
SocketAddr::V4(_) => {
is_ipv6 = false;
UdpSocket::bind("0.0.0.0:0").context(error::Network)?
UdpSocket::bind((Ipv4Addr::UNSPECIFIED, 0)).context(error::Network)?
}
SocketAddr::V6(_) => {
is_ipv6 = true;
UdpSocket::bind("[::]:0").context(error::Network)?
UdpSocket::bind((Ipv6Addr::UNSPECIFIED, 0)).context(error::Network)?
}
};
sock.connect(addr).context(error::Network)?;
Expand Down

0 comments on commit cc7d2d6

Please sign in to comment.