Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade trust-dns-server to 0.22.0 #4323

Merged
merged 2 commits into from
Feb 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 21 additions & 35 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion talpid-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ talpid-dbus = { path = "../talpid-dbus" }
[target.'cfg(target_os = "macos")'.dependencies]
pfctl = "0.4.4"
system-configuration = "0.5"
trust-dns-server = { version = "0.21.0-alpha.5", features = ["trust-dns-resolver"] }
trust-dns-server = { version = "0.22.0", features = ["resolver"] }
tun = "0.5.1"
subslice = "0.2"

Expand Down
15 changes: 7 additions & 8 deletions talpid-core/src/resolver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ mod test {
super::start_resolver().await.unwrap()
}

async fn get_test_resolver(port: u16) -> trust_dns_server::resolver::TokioAsyncResolver {
fn get_test_resolver(port: u16) -> trust_dns_server::resolver::TokioAsyncResolver {
let resolver_config = ResolverConfig::from_parts(
None,
vec![],
Expand All @@ -294,14 +294,13 @@ mod test {
fn test_successful_lookup() {
let rt = tokio::runtime::Runtime::new().unwrap();
let handle = rt.block_on(start_resolver());
let test_resolver = rt.block_on(get_test_resolver(handle.listening_port()));
let test_resolver = get_test_resolver(handle.listening_port());

let captive_portal_domain = LowerName::from(Name::from_str(CAPTIVE_PORTAL_DOMAIN).unwrap());
let resolver_result = rt.block_on(async move {
let dns_request =
test_resolver.lookup(captive_portal_domain, RecordType::A, Default::default());

dns_request.await
test_resolver
.lookup(captive_portal_domain, RecordType::A)
.await
});
resolver_result.expect("Failed to resolve test domain");
}
Expand All @@ -311,12 +310,12 @@ mod test {
let rt = tokio::runtime::Runtime::new().unwrap();

let handle = rt.block_on(start_resolver());
let test_resolver = rt.block_on(get_test_resolver(handle.listening_port()));
let test_resolver = get_test_resolver(handle.listening_port());

let captive_portal_domain = LowerName::from(Name::from_str("apple.com").unwrap());
let resolver_result = rt.block_on(async move {
test_resolver
.lookup(captive_portal_domain, RecordType::A, Default::default())
.lookup(captive_portal_domain, RecordType::A)
.await
});
assert!(
Expand Down