Skip to content

Commit 2c0a7d7

Browse files
authored
Update to hickory-resolver 0.25 (#1507)
1 parent cb35775 commit 2c0a7d7

File tree

6 files changed

+117
-98
lines changed

6 files changed

+117
-98
lines changed

Cargo.lock

Lines changed: 72 additions & 81 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ futures-io = "0.3.21"
9898
futures-core = "0.3.14"
9999
futures-util = { version = "0.3.14", features = ["io"] }
100100
hex = "0.4.0"
101-
hickory-proto = { version = "0.24.2", optional = true }
102-
hickory-resolver = { version = "0.24.2", optional = true }
101+
hickory-proto = { version = "0.25", optional = true }
102+
hickory-resolver = { version = "0.25", optional = true }
103103
hmac = "0.12.1"
104104
log = { version = "0.4.17", optional = true }
105105
md-5 = "0.10.1"

src/client/options/resolver_config.rs

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,41 @@ use hickory_resolver::config::ResolverConfig as HickoryResolverConfig;
55
///
66
/// This is a thin wrapper around a `hickory_resolver::config::ResolverConfig` provided to ensure
77
/// API stability.
8-
#[derive(Clone, Debug, PartialEq)]
8+
#[derive(Clone, Debug)]
9+
#[cfg_attr(not(feature = "dns-resolver"), derive(PartialEq))]
910
pub struct ResolverConfig {
1011
#[cfg(feature = "dns-resolver")]
1112
pub(crate) inner: HickoryResolverConfig,
1213
}
1314

15+
#[cfg(feature = "dns-resolver")]
16+
impl PartialEq for ResolverConfig {
17+
fn eq(&self, other: &Self) -> bool {
18+
let (left, right) = (&self.inner, &other.inner);
19+
20+
if !(left.domain() == right.domain()
21+
&& left.search() == right.search()
22+
&& left.name_servers().len() == right.name_servers().len())
23+
{
24+
return false;
25+
}
26+
27+
for (a, b) in std::iter::zip(left.name_servers(), right.name_servers()) {
28+
if !(a.socket_addr == b.socket_addr
29+
&& a.protocol == b.protocol
30+
&& a.tls_dns_name == b.tls_dns_name
31+
&& a.http_endpoint == b.http_endpoint
32+
&& a.trust_negative_responses == b.trust_negative_responses
33+
&& a.bind_addr == b.bind_addr)
34+
{
35+
return false;
36+
}
37+
}
38+
39+
true
40+
}
41+
}
42+
1443
#[cfg(feature = "dns-resolver")]
1544
impl ResolverConfig {
1645
/// Creates a default configuration, using 1.1.1.1, 1.0.0.1 and 2606:4700:4700::1111,

0 commit comments

Comments
 (0)