Development #8

Merged
mysticmomba merged 9 commits from development into master 2026-10-08 11:25:29 -04:00
2 changed files with 5 additions and 30 deletions
Showing only changes of commit 8cc8189820 - Show all commits
+5
View File
@@ -1,3 +1,8 @@
## [unreleased]
### 🐛 Bug Fixes
- Status Colors on Monitor tab now reflect status of host. Closes #7
## [0.2.0] - 2026-09-24
### 🚀 Features
-30
View File
@@ -1,5 +1,4 @@
use std::net::IpAddr;
use tokio::task::JoinSet;
/// Perform reverse DNS lookup on a single IP.
/// Returns the hostname if found, None otherwise.
@@ -19,32 +18,3 @@ pub async fn reverse_lookup(ip: IpAddr) -> Option<String> {
_ => None,
}
}
/// Perform reverse DNS lookups on a batch of IPs concurrently.
/// Returns a Vec of (IpAddr, Option<hostname>) pairs.
pub async fn reverse_lookup_batch(
ips: &[IpAddr],
max_concurrent: usize,
) -> Vec<(IpAddr, Option<String>)> {
let mut results = Vec::with_capacity(ips.len());
for chunk in ips.chunks(max_concurrent) {
let mut join_set = JoinSet::new();
for &ip in chunk {
join_set.spawn(async move {
let hostname = reverse_lookup(ip).await;
(ip, hostname)
});
}
while let Some(result) = join_set.join_next().await {
match result {
Ok(pair) => results.push(pair),
Err(e) => tracing::warn!("DNS lookup task panicked: {}", e),
}
}
}
results
}