pull/468/head
sigoden 2024-10-23 06:52:26 +08:00
parent 18a87198ff
commit 338301c7eb
1 changed files with 2 additions and 0 deletions

View File

@ -469,6 +469,7 @@ pub enum BindAddr {
impl BindAddr {
fn parse_addrs(addrs: &[&str]) -> Result<Vec<Self>> {
let mut bind_addrs = vec![];
#[cfg(not(unix))]
let mut invalid_addrs = vec![];
for addr in addrs {
match addr.parse::<IpAddr>() {
@ -483,6 +484,7 @@ impl BindAddr {
}
}
}
#[cfg(not(unix))]
if !invalid_addrs.is_empty() {
bail!("Invalid bind address `{}`", invalid_addrs.join(","));
}