diff options
| author | mat <git@matdoes.dev> | 2025-04-24 10:03:29 -1300 |
|---|---|---|
| committer | mat <git@matdoes.dev> | 2025-04-24 10:03:29 -1300 |
| commit | 54062c82fdd8a60ecfc79cd5e6252f9ead4c7a1b (patch) | |
| tree | aa53e75e0ce90636f76d09671f28569e9e176e52 /azalea-protocol | |
| parent | 0fc0fe41d4a8194a0f10f8a13e8194e89eb05d06 (diff) | |
| download | azalea-drasl-54062c82fdd8a60ecfc79cd5e6252f9ead4c7a1b.tar.xz | |
update to git hickory-resolver and use system resolver
Diffstat (limited to 'azalea-protocol')
| -rw-r--r-- | azalea-protocol/Cargo.toml | 2 | ||||
| -rw-r--r-- | azalea-protocol/src/resolver.rs | 12 |
2 files changed, 5 insertions, 9 deletions
diff --git a/azalea-protocol/Cargo.toml b/azalea-protocol/Cargo.toml index 6e264da8..d1215a92 100644 --- a/azalea-protocol/Cargo.toml +++ b/azalea-protocol/Cargo.toml @@ -46,7 +46,7 @@ thiserror.workspace = true tokio = { workspace = true, features = ["io-util", "net", "macros"] } tokio-util = { workspace = true, features = ["codec"] } tracing.workspace = true -hickory-resolver = { workspace = true, features = ["tokio"] } +hickory-resolver = { workspace = true, features = ["tokio", "system-config"] } uuid.workspace = true crc32fast = { workspace = true, optional = true } diff --git a/azalea-protocol/src/resolver.rs b/azalea-protocol/src/resolver.rs index c01a485b..4cd2faad 100644 --- a/azalea-protocol/src/resolver.rs +++ b/azalea-protocol/src/resolver.rs @@ -3,9 +3,7 @@ use std::net::{IpAddr, SocketAddr}; use async_recursion::async_recursion; -use hickory_resolver::{ - Name, TokioResolver, config::ResolverConfig, name_server::TokioConnectionProvider, -}; +use hickory_resolver::{Name, TokioResolver, name_server::TokioConnectionProvider}; use thiserror::Error; use crate::ServerAddress; @@ -31,11 +29,9 @@ pub async fn resolve_address(address: &ServerAddress) -> Result<SocketAddr, Reso // we specify Cloudflare instead of the default resolver because // hickory_resolver has an issue on Windows where it's really slow using the // default resolver - let resolver = TokioResolver::builder_with_config( - ResolverConfig::cloudflare(), - TokioConnectionProvider::default(), - ) - .build(); + let resolver = TokioResolver::builder(TokioConnectionProvider::default()) + .unwrap() + .build(); // first, we do a srv lookup for _minecraft._tcp.<host> let srv_redirect_result = resolver |
