Skip to content

Commit

Permalink
update trust-dns-resolver to 0.23
Browse files Browse the repository at this point in the history
With the mail-auth dep removed, we can now update this dep.
  • Loading branch information
wez committed Aug 23, 2023
1 parent dff9e50 commit 4d89501
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 34 deletions.
40 changes: 12 additions & 28 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,6 @@ mlua = "0.8"
rustls = "0.21"
tokio = "1.32"
tokio-rustls = "0.24"
trust-dns-resolver = "0.22" # can't upgrade to 0.23 due to mail-auth using 0.22
# Be sure to update the link to the docs in docs/reference/kumo.dns/configure_resolver.md
# to match the version that we are using when you update this dep
trust-dns-resolver = "0.23"
4 changes: 2 additions & 2 deletions crates/dns-resolver/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ pub async fn ipv4_lookup(key: &str) -> ResolveResult<(Arc<Vec<IpAddr>>, Instant)
let ips = ipv4_lookup
.as_lookup()
.record_iter()
.filter_map(|r| (IpAddr::from(*r.data()?.as_a()?).into()))
.filter_map(|r| Some(r.data()?.as_a()?.0.into()))
.collect::<Vec<_>>();

let ips = Arc::new(ips);
Expand All @@ -377,7 +377,7 @@ pub async fn ipv6_lookup(key: &str) -> ResolveResult<(Arc<Vec<IpAddr>>, Instant)
let ips = ipv6_lookup
.as_lookup()
.record_iter()
.filter_map(|r| (IpAddr::from(*r.data()?.as_aaaa()?)).into())
.filter_map(|r| Some(r.data()?.as_aaaa()?.0.into()))
.collect::<Vec<_>>();

let ips = Arc::new(ips);
Expand Down
4 changes: 2 additions & 2 deletions crates/mod-dns-resolver/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ pub fn register(lua: &Lua) -> anyhow::Result<()> {
.map_err(any_err)?;
let mut c = NameServerConfig::new(ip, protocol);

c.trust_nx_responses = trust_negative_responses;
c.trust_negative_responses = trust_negative_responses;

if let Some(bind) = bind_addr {
let addr: SocketAddr = bind
Expand All @@ -113,7 +113,7 @@ pub fn register(lua: &Lua) -> anyhow::Result<()> {
});
}

let resolver = TokioAsyncResolver::tokio(r_config, config.options).map_err(any_err)?;
let resolver = TokioAsyncResolver::tokio(r_config, config.options);

dns_resolver::reconfigure_resolver(resolver).await;

Expand Down
2 changes: 1 addition & 1 deletion docs/reference/kumo.dns/configure_resolver.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ your system configuration.
* `options` - a lua table listing out additional resolver options.
The possible names, values and meanings are documented in
the [trust DNS resolver ResolverOpts
documentation](https://docs.rs/trust-dns-resolver/0.22.0/trust_dns_resolver/config/struct.ResolverOpts.html)
documentation](https://docs.rs/trust-dns-resolver/0.23.0/trust_dns_resolver/config/struct.ResolverOpts.html)

```lua
kumo.on('init', function()
Expand Down

0 comments on commit 4d89501

Please sign in to comment.