aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHimbeer <himbeer@disroot.org>2025-03-24 13:47:15 +0100
committerHimbeer <himbeer@disroot.org>2025-03-24 13:47:15 +0100
commit1b75b8936b157f15632307c315d5fd1b585e1d21 (patch)
treee2405e11cbe7c6cb184be3398836548c8693c517
parent446914763b2d09040ae163afcef4211c469d98c9 (diff)
Fix infinite loop on failed connectivity check
-rw-r--r--src/main.rs10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/main.rs b/src/main.rs
index 8475693..1a0a443 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -227,14 +227,15 @@ fn check_connectivity(
}
Ok(_) => {
*outbound_healthy_v4 = true;
- break;
}
- Err(e) if e.kind() == io::ErrorKind::WouldBlock => {}
+ Err(e) if e.kind() == io::ErrorKind::WouldBlock => continue,
Err(e) => {
eprintln!("[warn] IPv4: read: {}", e);
*outbound_healthy_v4 = false;
}
}
+
+ break;
}
conn4.shutdown(Shutdown::Both)?;
@@ -264,14 +265,15 @@ fn check_connectivity(
}
Ok(_) => {
*outbound_healthy_v6 = true;
- break;
}
- Err(e) if e.kind() == io::ErrorKind::WouldBlock => {}
+ Err(e) if e.kind() == io::ErrorKind::WouldBlock => continue,
Err(e) => {
eprintln!("[warn] IPv6: read: {}", e);
*outbound_healthy_v6 = false;
}
}
+
+ break;
}
conn6.shutdown(Shutdown::Both)?;