v0.32.5
This commit is contained in:
1 parent
00218a72df
commit
4a3e4bcf8f
10 files changed
+745
-331
No files matched your search
+4
-1
@@ -86,9 +86,12 @@ pub(crate) fn configured_hostnames(config: &Config) -> Result<Vec<String>> {
|
||||
}
|
||||
|
||||
async fn resolve(name: String) -> (String, Option<Addresses>) {
|
||||
// Keep the returned cache key owned independently of the DNS lookup future.
|
||||
// The lookup result can retain the borrowed hostname until it is dropped.
|
||||
let lookup_name = name.clone();
|
||||
let answer = tokio::time::timeout(
|
||||
Duration::from_secs(LOOKUP_SECONDS),
|
||||
tokio::net::lookup_host((name.as_str(), 0u16)),
|
||||
tokio::net::lookup_host((lookup_name.as_str(), 0u16)),
|
||||
).await;
|
||||
let mut ips = match answer {
|
||||
Ok(Ok(sockets)) => sockets.map(|socket| socket.ip()).collect::<Vec<_>>(),
|
||||
|
||||
Reference in new issue
Block a user