Skip to content

Commit

Permalink
Only show DNS resolve errors in debug mode
Browse files Browse the repository at this point in the history
Signed-off-by: Adrian Reber <adrian@lisas.de>
  • Loading branch information
adrianreber committed Mar 22, 2021
1 parent 112c3ca commit 841aee2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/bin/generate-mirrorlist-cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,9 @@ fn parse_ip(input: String, host: String) -> Result<Vec<IpNet>, String> {
/* Probably DNS name */
let ips = lookup_host(&ip_string);
if ips.is_err() {
println!("DNS resolve error {} for host {}\n", ip_string, host);
if DEBUG.load(Ordering::SeqCst) == 1 {
println!("DNS resolve error {} for host {}\n", ip_string, host);
}
return Err("Parse Error".to_string());
}
let mut result: Vec<IpNet> = Vec::new();
Expand Down

0 comments on commit 841aee2

Please sign in to comment.