From af0a7b4bb19a5188b91aa4b7f70c80a0550e7937 Mon Sep 17 00:00:00 2001 From: BiagioFesta <15035284+BiagioFesta@users.noreply.github.com> Date: Sat, 2 Dec 2023 23:39:17 +0100 Subject: [PATCH] config/dns-resolver: make it so endpoint is Send again --- wtransport/src/config.rs | 8 ++++---- wtransport/src/endpoint.rs | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/wtransport/src/config.rs b/wtransport/src/config.rs index 58b924c9..c92dd626 100644 --- a/wtransport/src/config.rs +++ b/wtransport/src/config.rs @@ -531,7 +531,7 @@ pub struct ClientConfig { pub(crate) bind_address: SocketAddr, pub(crate) dual_stack_config: Ipv6DualStackConfig, pub(crate) quic_config: QuicClientConfig, - pub(crate) dns_resolver: Box, + pub(crate) dns_resolver: Box, } impl ClientConfig { @@ -788,7 +788,7 @@ impl ClientConfigBuilder { /// Sets the *DNS* resolver used during [`Endpoint::connect`](crate::Endpoint::connect). /// /// Default configuration uses [`TokioDnsResolver`]. - pub fn dns_resolver(mut self, dns_resolver: Box) -> Self { + pub fn dns_resolver(mut self, dns_resolver: Box) -> Self { self.0.dns_resolver = dns_resolver; self } @@ -836,7 +836,7 @@ pub struct WantsTransportConfigClient { dual_stack_config: Ipv6DualStackConfig, tls_config: TlsClientConfig, transport_config: quinn::TransportConfig, - dns_resolver: Box, + dns_resolver: Box, } #[cfg(feature = "dangerous-configuration")] @@ -866,7 +866,7 @@ mod dangerous_configuration { /// `DynFutureResolver` is a trait object type alias that represents a future yielding /// a result of DNS resolution. The future's output is of type `std::io::Result>`, /// indicating the result of the DNS resolution operation. -pub type DynFutureResolver = dyn Future>>; +pub type DynFutureResolver = dyn Future>> + Send; /// A trait for asynchronously resolving domain names to IP addresses using DNS. pub trait DnsResolver { diff --git a/wtransport/src/endpoint.rs b/wtransport/src/endpoint.rs index 7cadb29c..e88124d3 100644 --- a/wtransport/src/endpoint.rs +++ b/wtransport/src/endpoint.rs @@ -50,7 +50,7 @@ pub mod endpoint_side { /// /// Use [`Endpoint::client`] to create and client-endpoint. pub struct Client { - pub(super) dns_resolver: Box, + pub(super) dns_resolver: Box, } }