Skip to content

Commit

Permalink
migrate trust_dns to hickory
Browse files Browse the repository at this point in the history
  • Loading branch information
zephyrchien committed Dec 10, 2023
1 parent 7d234b9 commit f74cca5
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 72 deletions.
121 changes: 57 additions & 64 deletions Cargo.lock

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

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "realm"
version = "2.4.6"
version = "2.5.0"
authors = ["zhboner <zhboner@gmail.com>"]
edition = "2021"

Expand Down Expand Up @@ -42,7 +42,7 @@ chrono = "0.4"

# command
clap = "3.1"
toml = "0.7"
toml = "0.8"
serde = { version = "1", features = ["derive"] }
serde_json = "1"

Expand Down
6 changes: 3 additions & 3 deletions realm_core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "realm_core"
version = "0.3.7"
version = "0.3.8"
authors = ["Realm Contributors"]
description = "Realm's core facilities."
repository = "https://github.com/zhboner/realm/realm_core"
Expand All @@ -24,8 +24,8 @@ log = "0.4"
bytes = { version = "1", optional = true }
once_cell = "1"
pin-project = "1"
trust-dns-resolver = "0.22"
tokio = { version = "1.18", features = ["rt", "net", "time"] }
hickory-resolver = "0.24"
tokio = { version = "1.9", features = ["rt", "net", "time"] }
proxy-protocol = { version = "0.5", optional = true }

[features]
Expand Down
4 changes: 2 additions & 2 deletions realm_core/src/dns/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
use std::io::{Result, Error, ErrorKind};
use std::net::SocketAddr;

use trust_dns_resolver as resolver;
use hickory_resolver as resolver;
use resolver::TokioAsyncResolver;
use resolver::system_conf::read_system_conf;
use resolver::lookup_ip::{LookupIp, LookupIpIter};
Expand Down Expand Up @@ -39,7 +39,7 @@ static mut DNS_CONF: OnceCell<DnsConf> = OnceCell::new();

static mut DNS: Lazy<TokioAsyncResolver> = Lazy::new(|| {
let DnsConf { conf, opts } = unsafe { DNS_CONF.take().unwrap() };
TokioAsyncResolver::tokio(conf, opts).unwrap()
TokioAsyncResolver::tokio(conf, opts)
});

/// Setup global dns resolver. This is not thread-safe!
Expand Down
2 changes: 1 addition & 1 deletion src/conf/dns.rs
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ impl Config for DnsConf {
socket_addr,
protocol,
tls_dns_name: None,
trust_nx_responses: true,
trust_negative_responses: true,
bind_addr: None,
});
}
Expand Down

0 comments on commit f74cca5

Please sign in to comment.