-
Notifications
You must be signed in to change notification settings - Fork 963
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[libp2p-dns] Use trust-dns-resolver (with either async-std or tokio).…
… Remove thread pool. (#1927) * [libp2p-dns] Use trust-dns-resolver. Use the `trust-dns-resolver` library for DNS resolution, thereby removing current use of the thread pool. Since `trust-dns-resolver` and related crates already provide support for both `async-std` and `tokio`, we make use of that here in our own feature flags. Since `trust-dns-resolver` provides many useful configuration options and error detail, central types of `trust-dns-resolver` like `ResolverConfig`, `ResolverOpts` and `ResolveError` are re-exposed in the API of `libp2p-dns`. Full encapsulation does not seem preferable in this case. * Cleanup * Fix two intra-doc links. * Simplify slightly. * Incorporate review feedback. * Remove git dependency and fix example. * Update version and changelogs.
- Loading branch information
Showing
12 changed files
with
334 additions
and
211 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
name = "libp2p-dns" | ||
edition = "2018" | ||
description = "DNS transport implementation for libp2p" | ||
version = "0.27.0" | ||
version = "0.28.0" | ||
authors = ["Parity Technologies <[email protected]>"] | ||
license = "MIT" | ||
repository = "https://github.com/libp2p/rust-libp2p" | ||
|
@@ -13,3 +13,21 @@ categories = ["network-programming", "asynchronous"] | |
libp2p-core = { version = "0.27.0", path = "../../core" } | ||
log = "0.4.1" | ||
futures = "0.3.1" | ||
trust-dns-resolver = { version = "0.20", default-features = false, features = ["system-config"] } | ||
async-std-resolver = { version = "0.20", optional = true } | ||
|
||
[dev-dependencies] | ||
env_logger = "0.6" | ||
tokio-crate = { package = "tokio", version = "1.0", default-features = false, features = ["rt", "time"] } | ||
async-std-crate = { package = "async-std", version = "1.6" } | ||
|
||
[features] | ||
default = ["async-std"] | ||
async-std = ["async-std-resolver"] | ||
tokio = ["trust-dns-resolver/tokio-runtime"] | ||
# The `tokio-` prefix and feature dependency is just to be explicit, | ||
# since these features of `trust-dns-resolver` are currently only | ||
# available for `tokio`. | ||
tokio-dns-over-rustls = ["tokio", "trust-dns-resolver/dns-over-rustls"] | ||
tokio-dns-over-https-rustls = ["tokio", "trust-dns-resolver/dns-over-https-rustls"] | ||
|
Oops, something went wrong.