1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-18 05:14:21 -05:00

chore: update hickory dns crates (#27137)

This commit is contained in:
Luca Casonato 2024-12-05 15:11:35 +01:00 committed by GitHub
parent 25aed5071f
commit ae5c743f33
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 158 additions and 100 deletions

196
Cargo.lock generated
View file

@ -284,6 +284,17 @@ dependencies = [
"tokio", "tokio",
] ]
[[package]]
name = "async-recursion"
version = "1.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.87",
]
[[package]] [[package]]
name = "async-stream" name = "async-stream"
version = "0.3.5" version = "0.3.5"
@ -806,6 +817,7 @@ dependencies = [
"file_test_runner", "file_test_runner",
"flaky_test", "flaky_test",
"hickory-client", "hickory-client",
"hickory-proto",
"hickory-server", "hickory-server",
"http 1.1.0", "http 1.1.0",
"http-body-util", "http-body-util",
@ -1293,7 +1305,7 @@ dependencies = [
"test_server", "test_server",
"text-size", "text-size",
"text_lines", "text_lines",
"thiserror 1.0.64", "thiserror 2.0.3",
"tokio", "tokio",
"tokio-util", "tokio-util",
"tracing", "tracing",
@ -1380,7 +1392,7 @@ version = "0.174.0"
dependencies = [ dependencies = [
"async-trait", "async-trait",
"deno_core", "deno_core",
"thiserror 1.0.64", "thiserror 2.0.3",
"tokio", "tokio",
"uuid", "uuid",
] ]
@ -1394,7 +1406,7 @@ dependencies = [
"rusqlite", "rusqlite",
"serde", "serde",
"sha2", "sha2",
"thiserror 1.0.64", "thiserror 2.0.3",
"tokio", "tokio",
] ]
@ -1426,7 +1438,7 @@ dependencies = [
"deno_webgpu", "deno_webgpu",
"image", "image",
"serde", "serde",
"thiserror 1.0.64", "thiserror 2.0.3",
] ]
[[package]] [[package]]
@ -1510,7 +1522,7 @@ dependencies = [
"chrono", "chrono",
"deno_core", "deno_core",
"saffron", "saffron",
"thiserror 1.0.64", "thiserror 2.0.3",
"tokio", "tokio",
] ]
@ -1545,7 +1557,7 @@ dependencies = [
"sha2", "sha2",
"signature", "signature",
"spki", "spki",
"thiserror 1.0.64", "thiserror 2.0.3",
"tokio", "tokio",
"uuid", "uuid",
"x25519-dalek", "x25519-dalek",
@ -1627,7 +1639,7 @@ dependencies = [
"rustls-webpki", "rustls-webpki",
"serde", "serde",
"serde_json", "serde_json",
"thiserror 1.0.64", "thiserror 2.0.3",
"tokio", "tokio",
"tokio-rustls", "tokio-rustls",
"tokio-socks", "tokio-socks",
@ -1652,7 +1664,7 @@ dependencies = [
"serde", "serde",
"serde-value", "serde-value",
"serde_json", "serde_json",
"thiserror 1.0.64", "thiserror 2.0.3",
"tokio", "tokio",
"winapi", "winapi",
] ]
@ -1675,7 +1687,7 @@ dependencies = [
"rand", "rand",
"rayon", "rayon",
"serde", "serde",
"thiserror 1.0.64", "thiserror 2.0.3",
"winapi", "winapi",
"windows-sys 0.59.0", "windows-sys 0.59.0",
] ]
@ -1744,7 +1756,7 @@ dependencies = [
"scopeguard", "scopeguard",
"serde", "serde",
"smallvec", "smallvec",
"thiserror 1.0.64", "thiserror 2.0.3",
"tokio", "tokio",
"tokio-util", "tokio-util",
] ]
@ -1798,7 +1810,7 @@ dependencies = [
"rand", "rand",
"rusqlite", "rusqlite",
"serde", "serde",
"thiserror 1.0.64", "thiserror 2.0.3",
"url", "url",
] ]
@ -1854,7 +1866,7 @@ dependencies = [
"libuv-sys-lite", "libuv-sys-lite",
"log", "log",
"napi_sym", "napi_sym",
"thiserror 1.0.64", "thiserror 2.0.3",
"windows-sys 0.59.0", "windows-sys 0.59.0",
] ]
@ -1884,7 +1896,7 @@ dependencies = [
"rustls-tokio-stream", "rustls-tokio-stream",
"serde", "serde",
"socket2", "socket2",
"thiserror 1.0.64", "thiserror 2.0.3",
"tokio", "tokio",
] ]
@ -1929,7 +1941,7 @@ dependencies = [
"http-body-util", "http-body-util",
"hyper 1.4.1", "hyper 1.4.1",
"hyper-util", "hyper-util",
"idna 1.0.3", "idna",
"indexmap 2.3.0", "indexmap 2.3.0",
"ipnetwork", "ipnetwork",
"k256", "k256",
@ -1968,7 +1980,7 @@ dependencies = [
"sm3", "sm3",
"spki", "spki",
"stable_deref_trait", "stable_deref_trait",
"thiserror 1.0.64", "thiserror 2.0.3",
"tokio", "tokio",
"tokio-eld", "tokio-eld",
"url", "url",
@ -2024,7 +2036,7 @@ dependencies = [
"serde_json", "serde_json",
"tar", "tar",
"tempfile", "tempfile",
"thiserror 1.0.64", "thiserror 2.0.3",
"url", "url",
] ]
@ -2084,7 +2096,7 @@ dependencies = [
"once_cell", "once_cell",
"percent-encoding", "percent-encoding",
"serde", "serde",
"thiserror 1.0.64", "thiserror 2.0.3",
"which 4.4.2", "which 4.4.2",
"winapi", "winapi",
] ]
@ -2104,7 +2116,7 @@ dependencies = [
"deno_semver", "deno_semver",
"node_resolver", "node_resolver",
"test_server", "test_server",
"thiserror 1.0.64", "thiserror 2.0.3",
"url", "url",
] ]
@ -2167,7 +2179,7 @@ dependencies = [
"signal-hook-registry", "signal-hook-registry",
"tempfile", "tempfile",
"test_server", "test_server",
"thiserror 1.0.64", "thiserror 2.0.3",
"tokio", "tokio",
"tokio-metrics", "tokio-metrics",
"twox-hash", "twox-hash",
@ -2261,7 +2273,7 @@ dependencies = [
"rustls-tokio-stream", "rustls-tokio-stream",
"rustls-webpki", "rustls-webpki",
"serde", "serde",
"thiserror 1.0.64", "thiserror 2.0.3",
"tokio", "tokio",
"webpki-roots", "webpki-roots",
] ]
@ -2308,7 +2320,7 @@ dependencies = [
"deno_console", "deno_console",
"deno_core", "deno_core",
"deno_webidl", "deno_webidl",
"thiserror 1.0.64", "thiserror 2.0.3",
"urlpattern", "urlpattern",
] ]
@ -2329,7 +2341,7 @@ dependencies = [
"flate2", "flate2",
"futures", "futures",
"serde", "serde",
"thiserror 1.0.64", "thiserror 2.0.3",
"tokio", "tokio",
"uuid", "uuid",
] ]
@ -2341,7 +2353,7 @@ dependencies = [
"deno_core", "deno_core",
"raw-window-handle", "raw-window-handle",
"serde", "serde",
"thiserror 1.0.64", "thiserror 2.0.3",
"tokio", "tokio",
"wgpu-core", "wgpu-core",
"wgpu-types", "wgpu-types",
@ -2373,7 +2385,7 @@ dependencies = [
"once_cell", "once_cell",
"rustls-tokio-stream", "rustls-tokio-stream",
"serde", "serde",
"thiserror 1.0.64", "thiserror 2.0.3",
"tokio", "tokio",
] ]
@ -2384,7 +2396,7 @@ dependencies = [
"deno_core", "deno_core",
"deno_web", "deno_web",
"rusqlite", "rusqlite",
"thiserror 1.0.64", "thiserror 2.0.3",
] ]
[[package]] [[package]]
@ -3698,9 +3710,9 @@ checksum = "dfa686283ad6dd069f105e5ab091b04c62850d3e4cf5d67debad1933f55023df"
[[package]] [[package]]
name = "hickory-client" name = "hickory-client"
version = "0.24.1" version = "0.25.0-alpha.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bab9683b08d8f8957a857b0236455d80e1886eaa8c6178af556aa7871fb61b55" checksum = "83536dab9a159b2b5cf2c20c47ecf188cee35316f96be028e63e8e1340d2724d"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"data-encoding", "data-encoding",
@ -3710,17 +3722,18 @@ dependencies = [
"once_cell", "once_cell",
"radix_trie", "radix_trie",
"rand", "rand",
"thiserror 1.0.64", "thiserror 2.0.3",
"tokio", "tokio",
"tracing", "tracing",
] ]
[[package]] [[package]]
name = "hickory-proto" name = "hickory-proto"
version = "0.24.1" version = "0.25.0-alpha.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "07698b8420e2f0d6447a436ba999ec85d8fbf2a398bbd737b82cac4a2e96e512" checksum = "d063c0692ee669aa6d261988aa19ca5510f1cc40e4f211024f50c888499a35d7"
dependencies = [ dependencies = [
"async-recursion",
"async-trait", "async-trait",
"cfg-if", "cfg-if",
"data-encoding", "data-encoding",
@ -3728,12 +3741,12 @@ dependencies = [
"futures-channel", "futures-channel",
"futures-io", "futures-io",
"futures-util", "futures-util",
"idna 0.4.0", "idna",
"ipnet", "ipnet",
"once_cell", "once_cell",
"rand", "rand",
"serde", "serde",
"thiserror 1.0.64", "thiserror 2.0.3",
"tinyvec", "tinyvec",
"tokio", "tokio",
"tracing", "tracing",
@ -3742,40 +3755,43 @@ dependencies = [
[[package]] [[package]]
name = "hickory-resolver" name = "hickory-resolver"
version = "0.24.1" version = "0.25.0-alpha.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "28757f23aa75c98f254cf0405e6d8c25b831b32921b050a66692427679b1f243" checksum = "42bc352e4412fb657e795f79b4efcf2bd60b59ee5ca0187f3554194cd1107a27"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"futures-util", "futures-util",
"hickory-proto", "hickory-proto",
"ipconfig", "ipconfig",
"lru-cache", "moka",
"once_cell", "once_cell",
"parking_lot", "parking_lot",
"rand", "rand",
"resolv-conf", "resolv-conf",
"serde", "serde",
"smallvec", "smallvec",
"thiserror 1.0.64", "thiserror 2.0.3",
"tokio", "tokio",
"tracing", "tracing",
] ]
[[package]] [[package]]
name = "hickory-server" name = "hickory-server"
version = "0.24.1" version = "0.25.0-alpha.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9be0e43c556b9b3fdb6c7c71a9a32153a2275d02419e3de809e520bfcfe40c37" checksum = "aa7154e905d5c8a79c15427881e479b2ba749c55412804f0dc87723a531e45bd"
dependencies = [ dependencies = [
"async-trait", "async-trait",
"bytes", "bytes",
"cfg-if", "cfg-if",
"data-encoding",
"enum-as-inner", "enum-as-inner",
"futures-util", "futures-util",
"hickory-proto", "hickory-proto",
"ipnet",
"prefix-trie",
"serde", "serde",
"thiserror 1.0.64", "thiserror 2.0.3",
"time", "time",
"tokio", "tokio",
"tokio-util", "tokio-util",
@ -4137,16 +4153,6 @@ version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39"
[[package]]
name = "idna"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c"
dependencies = [
"unicode-bidi",
"unicode-normalization",
]
[[package]] [[package]]
name = "idna" name = "idna"
version = "1.0.3" version = "1.0.3"
@ -4287,6 +4293,9 @@ name = "ipnet"
version = "2.9.0" version = "2.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3"
dependencies = [
"serde",
]
[[package]] [[package]]
name = "ipnetwork" name = "ipnetwork"
@ -4625,12 +4634,6 @@ dependencies = [
"vcpkg", "vcpkg",
] ]
[[package]]
name = "linked-hash-map"
version = "0.5.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f"
[[package]] [[package]]
name = "linux-raw-sys" name = "linux-raw-sys"
version = "0.4.13" version = "0.4.13"
@ -4668,15 +4671,6 @@ dependencies = [
"serde", "serde",
] ]
[[package]]
name = "lru-cache"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "31e24f1ad8321ca0e8a1e0ac13f23cb668e6f5466c2c57319f6a5cf1cc8e3b1c"
dependencies = [
"linked-hash-map",
]
[[package]] [[package]]
name = "lsp-types" name = "lsp-types"
version = "0.97.0" version = "0.97.0"
@ -4841,6 +4835,26 @@ dependencies = [
"windows-sys 0.48.0", "windows-sys 0.48.0",
] ]
[[package]]
name = "moka"
version = "0.12.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9e0d88686dc561d743b40de8269b26eaf0dc58781bde087b0984646602021d08"
dependencies = [
"crossbeam-channel",
"crossbeam-epoch",
"crossbeam-utils",
"once_cell",
"parking_lot",
"quanta",
"rustc_version 0.4.0",
"smallvec",
"tagptr",
"thiserror 1.0.64",
"triomphe",
"uuid",
]
[[package]] [[package]]
name = "monch" name = "monch"
version = "0.5.0" version = "0.5.0"
@ -4961,7 +4975,7 @@ dependencies = [
"path-clean", "path-clean",
"regex", "regex",
"serde_json", "serde_json",
"thiserror 1.0.64", "thiserror 2.0.3",
"tokio", "tokio",
"url", "url",
] ]
@ -5120,9 +5134,9 @@ dependencies = [
[[package]] [[package]]
name = "once_cell" name = "once_cell"
version = "1.19.0" version = "1.20.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775"
[[package]] [[package]]
name = "opaque-debug" name = "opaque-debug"
@ -5617,6 +5631,16 @@ version = "0.2.17"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de"
[[package]]
name = "prefix-trie"
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4defc8f5ac7522968431b7592a34432215d80cceb1cf7e0c06287087bca4f046"
dependencies = [
"ipnet",
"num-traits",
]
[[package]] [[package]]
name = "pretty_assertions" name = "pretty_assertions"
version = "1.4.0" version = "1.4.0"
@ -5812,6 +5836,21 @@ dependencies = [
"unicase", "unicase",
] ]
[[package]]
name = "quanta"
version = "0.12.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8e5167a477619228a0b284fac2674e3c388cba90631d7b7de620e6f1fcd08da5"
dependencies = [
"crossbeam-utils",
"libc",
"once_cell",
"raw-cpuid",
"wasi",
"web-sys",
"winapi",
]
[[package]] [[package]]
name = "quick-error" name = "quick-error"
version = "1.2.3" version = "1.2.3"
@ -5976,6 +6015,15 @@ version = "0.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9c8a99fddc9f0ba0a85884b8d14e3592853e787d581ca1816c91349b10e4eeab" checksum = "9c8a99fddc9f0ba0a85884b8d14e3592853e787d581ca1816c91349b10e4eeab"
[[package]]
name = "raw-cpuid"
version = "11.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1ab240315c661615f2ee9f0f2cd32d5a7343a84d5ebcccb99d46e6637565e7b0"
dependencies = [
"bitflags 2.6.0",
]
[[package]] [[package]]
name = "raw-window-handle" name = "raw-window-handle"
version = "0.6.1" version = "0.6.1"
@ -7509,6 +7557,12 @@ dependencies = [
"syn 2.0.87", "syn 2.0.87",
] ]
[[package]]
name = "tagptr"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7b2093cf4c8eb1e67749a6762251bc9cd836b6fc171623bd0a9d324d37af2417"
[[package]] [[package]]
name = "tap" name = "tap"
version = "1.0.1" version = "1.0.1"
@ -8083,12 +8137,6 @@ dependencies = [
"version_check", "version_check",
] ]
[[package]]
name = "unicode-bidi"
version = "0.3.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75"
[[package]] [[package]]
name = "unicode-id" name = "unicode-id"
version = "0.3.4" version = "0.3.4"
@ -8163,7 +8211,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8d157f1b96d14500ffdc1f10ba712e780825526c03d9a49b4d0324b0d9113ada" checksum = "8d157f1b96d14500ffdc1f10ba712e780825526c03d9a49b4d0324b0d9113ada"
dependencies = [ dependencies = [
"form_urlencoded", "form_urlencoded",
"idna 1.0.3", "idna",
"percent-encoding", "percent-encoding",
"serde", "serde",
] ]

View file

@ -133,7 +133,7 @@ fs3 = "0.5.0"
futures = "0.3.21" futures = "0.3.21"
glob = "0.3.1" glob = "0.3.1"
h2 = "0.4.4" h2 = "0.4.4"
hickory-resolver = { version = "0.24", features = ["tokio-runtime", "serde-config"] } hickory-resolver = { version = "0.25.0-alpha.4", features = ["tokio-runtime", "serde"] }
http = "1.0" http = "1.0"
http-body = "1.0" http-body = "1.0"
http-body-util = "0.1.2" http-body-util = "0.1.2"
@ -194,7 +194,7 @@ spki = "0.7.2"
tar = "=0.4.40" tar = "=0.4.40"
tempfile = "3.4.0" tempfile = "3.4.0"
termcolor = "1.1.3" termcolor = "1.1.3"
thiserror = "1.0.61" thiserror = "2.0.3"
tokio = { version = "1.36.0", features = ["full"] } tokio = { version = "1.36.0", features = ["full"] }
tokio-metrics = { version = "0.3.0", features = ["rt"] } tokio-metrics = { version = "0.3.0", features = ["rt"] }
tokio-rustls = { version = "0.26.0", default-features = false, features = ["ring", "tls12"] } tokio-rustls = { version = "0.26.0", default-features = false, features = ["ring", "tls12"] }

View file

@ -7,10 +7,7 @@ use std::task::Poll;
use std::task::{self}; use std::task::{self};
use std::vec; use std::vec;
use hickory_resolver::error::ResolveError; use hickory_resolver::name_server::TokioConnectionProvider;
use hickory_resolver::name_server::GenericConnector;
use hickory_resolver::name_server::TokioRuntimeProvider;
use hickory_resolver::AsyncResolver;
use hyper_util::client::legacy::connect::dns::GaiResolver; use hyper_util::client::legacy::connect::dns::GaiResolver;
use hyper_util::client::legacy::connect::dns::Name; use hyper_util::client::legacy::connect::dns::Name;
use tokio::task::JoinHandle; use tokio::task::JoinHandle;
@ -21,7 +18,7 @@ pub enum Resolver {
/// A resolver using blocking `getaddrinfo` calls in a threadpool. /// A resolver using blocking `getaddrinfo` calls in a threadpool.
Gai(GaiResolver), Gai(GaiResolver),
/// hickory-resolver's userspace resolver. /// hickory-resolver's userspace resolver.
Hickory(AsyncResolver<GenericConnector<TokioRuntimeProvider>>), Hickory(hickory_resolver::Resolver<TokioConnectionProvider>),
} }
impl Default for Resolver { impl Default for Resolver {
@ -36,14 +33,14 @@ impl Resolver {
} }
/// Create a [`AsyncResolver`] from system conf. /// Create a [`AsyncResolver`] from system conf.
pub fn hickory() -> Result<Self, ResolveError> { pub fn hickory() -> Result<Self, hickory_resolver::ResolveError> {
Ok(Self::Hickory( Ok(Self::Hickory(
hickory_resolver::AsyncResolver::tokio_from_system_conf()?, hickory_resolver::Resolver::tokio_from_system_conf()?,
)) ))
} }
pub fn hickory_from_async_resolver( pub fn hickory_from_resolver(
resolver: AsyncResolver<GenericConnector<TokioRuntimeProvider>>, resolver: hickory_resolver::Resolver<TokioConnectionProvider>,
) -> Self { ) -> Self {
Self::Hickory(resolver) Self::Hickory(resolver)
} }

View file

@ -41,7 +41,7 @@ fn test_userspace_resolver() {
// use `localhost` to ensure dns step happens. // use `localhost` to ensure dns step happens.
let addr = format!("localhost:{}", src_addr.port()); let addr = format!("localhost:{}", src_addr.port());
let hickory = hickory_resolver::AsyncResolver::tokio( let hickory = hickory_resolver::Resolver::tokio(
Default::default(), Default::default(),
Default::default(), Default::default(),
); );
@ -52,7 +52,7 @@ fn test_userspace_resolver() {
addr.clone(), addr.clone(),
"https", "https",
http::Version::HTTP_2, http::Version::HTTP_2,
dns::Resolver::hickory_from_async_resolver(hickory), dns::Resolver::hickory_from_resolver(hickory),
) )
.await; .await;
assert_eq!(thread_counter.load(SeqCst), 0, "userspace resolver shouldn't spawn new threads."); assert_eq!(thread_counter.load(SeqCst), 0, "userspace resolver shouldn't spawn new threads.");

View file

@ -17,7 +17,7 @@ path = "lib.rs"
deno_core.workspace = true deno_core.workspace = true
deno_permissions.workspace = true deno_permissions.workspace = true
deno_tls.workspace = true deno_tls.workspace = true
hickory-proto = "0.24" hickory-proto = "0.25.0-alpha.4"
hickory-resolver.workspace = true hickory-resolver.workspace = true
pin-project.workspace = true pin-project.workspace = true
rustls-tokio-stream.workspace = true rustls-tokio-stream.workspace = true

View file

@ -21,13 +21,14 @@ use deno_core::ResourceId;
use hickory_proto::rr::rdata::caa::Value; use hickory_proto::rr::rdata::caa::Value;
use hickory_proto::rr::record_data::RData; use hickory_proto::rr::record_data::RData;
use hickory_proto::rr::record_type::RecordType; use hickory_proto::rr::record_type::RecordType;
use hickory_proto::ProtoError;
use hickory_proto::ProtoErrorKind;
use hickory_resolver::config::NameServerConfigGroup; use hickory_resolver::config::NameServerConfigGroup;
use hickory_resolver::config::ResolverConfig; use hickory_resolver::config::ResolverConfig;
use hickory_resolver::config::ResolverOpts; use hickory_resolver::config::ResolverOpts;
use hickory_resolver::error::ResolveError;
use hickory_resolver::error::ResolveErrorKind;
use hickory_resolver::system_conf; use hickory_resolver::system_conf;
use hickory_resolver::AsyncResolver; use hickory_resolver::ResolveError;
use hickory_resolver::ResolveErrorKind;
use serde::Deserialize; use serde::Deserialize;
use serde::Serialize; use serde::Serialize;
use socket2::Domain; use socket2::Domain;
@ -646,7 +647,7 @@ where
} }
} }
let resolver = AsyncResolver::tokio(config, opts); let resolver = hickory_resolver::Resolver::tokio(config, opts);
let lookup_fut = resolver.lookup(query, record_type); let lookup_fut = resolver.lookup(query, record_type);
@ -674,11 +675,21 @@ where
lookup lookup
.map_err(|e| match e.kind() { .map_err(|e| match e.kind() {
ResolveErrorKind::NoRecordsFound { .. } => NetError::DnsNotFound(e), ResolveErrorKind::Proto(ProtoError { kind, .. })
ResolveErrorKind::Message("No connections available") => { if matches!(**kind, ProtoErrorKind::NoRecordsFound { .. }) =>
{
NetError::DnsNotFound(e)
}
ResolveErrorKind::Proto(ProtoError { kind, .. })
if matches!(**kind, ProtoErrorKind::NoConnections { .. }) =>
{
NetError::DnsNotConnected(e) NetError::DnsNotConnected(e)
} }
ResolveErrorKind::Timeout => NetError::DnsTimedOut(e), ResolveErrorKind::Proto(ProtoError { kind, .. })
if matches!(**kind, ProtoErrorKind::Timeout { .. }) =>
{
NetError::DnsTimedOut(e)
}
_ => NetError::Dns(e), _ => NetError::Dns(e),
})? })?
.iter() .iter()

View file

@ -47,8 +47,9 @@ deno_tls.workspace = true
fastwebsockets = { workspace = true, features = ["upgrade", "unstable-split"] } fastwebsockets = { workspace = true, features = ["upgrade", "unstable-split"] }
file_test_runner = "0.7.3" file_test_runner = "0.7.3"
flaky_test = "=0.2.2" flaky_test = "=0.2.2"
hickory-client = "=0.24" hickory-client = "0.25.0-alpha.4"
hickory-server = "=0.24" hickory-proto = "0.25.0-alpha.4"
hickory-server = "0.25.0-alpha.4"
http.workspace = true http.workspace = true
http-body-util.workspace = true http-body-util.workspace = true
hyper.workspace = true hyper.workspace = true

View file

@ -16,7 +16,8 @@ use deno_tls::rustls;
use deno_tls::rustls::ClientConnection; use deno_tls::rustls::ClientConnection;
use deno_tls::rustls_pemfile; use deno_tls::rustls_pemfile;
use deno_tls::TlsStream; use deno_tls::TlsStream;
use hickory_client::serialize::txt::Parser; use hickory_proto::serialize::txt::Parser;
use hickory_server::authority::AuthorityObject;
use pretty_assertions::assert_eq; use pretty_assertions::assert_eq;
use test_util as util; use test_util as util;
use test_util::itest; use test_util::itest;
@ -2245,10 +2246,10 @@ async fn test_resolve_dns() {
panic!("failed to parse: {:?}", records.err()) panic!("failed to parse: {:?}", records.err())
} }
let (origin, records) = records.unwrap(); let (origin, records) = records.unwrap();
let authority = Box::new(Arc::new( let authority: Vec<Arc<dyn AuthorityObject>> = vec![Arc::new(
InMemoryAuthority::new(origin, records, ZoneType::Primary, false) InMemoryAuthority::new(origin, records, ZoneType::Primary, false)
.unwrap(), .unwrap(),
)); )];
let mut catalog: Catalog = Catalog::new(); let mut catalog: Catalog = Catalog::new();
catalog.upsert(Name::root().into(), authority); catalog.upsert(Name::root().into(), authority);