reduce tls override cache lock exposure
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
parent
17d0c869b0
commit
b7a494c40d
1 changed files with 6 additions and 8 deletions
|
@ -88,14 +88,12 @@ impl Resolve for Resolver {
|
||||||
|
|
||||||
impl Resolve for Hooked {
|
impl Resolve for Hooked {
|
||||||
fn resolve(&self, name: Name) -> Resolving {
|
fn resolve(&self, name: Name) -> Resolving {
|
||||||
self.overrides
|
let addr_port = self.overrides.read().unwrap().get(name.as_str()).cloned();
|
||||||
.read()
|
if let Some((addr, port)) = addr_port {
|
||||||
.unwrap()
|
cached_to_reqwest(&addr, port)
|
||||||
.get(name.as_str())
|
} else {
|
||||||
.map_or_else(
|
resolve_to_reqwest(self.resolver.clone(), name)
|
||||||
|| resolve_to_reqwest(self.resolver.clone(), name),
|
}
|
||||||
|(override_name, port)| cached_to_reqwest(override_name, *port),
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue