Skip to content

Commit

Permalink
config/dns-resolver: make it so endpoint is Send again
Browse files Browse the repository at this point in the history
  • Loading branch information
BiagioFesta committed Dec 2, 2023
1 parent def583c commit af0a7b4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions wtransport/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<dyn DnsResolver>,
pub(crate) dns_resolver: Box<dyn DnsResolver + Send + Sync>,
}

impl ClientConfig {
Expand Down Expand Up @@ -788,7 +788,7 @@ impl ClientConfigBuilder<WantsTransportConfigClient> {
/// Sets the *DNS* resolver used during [`Endpoint::connect`](crate::Endpoint::connect).
///
/// Default configuration uses [`TokioDnsResolver`].
pub fn dns_resolver(mut self, dns_resolver: Box<dyn DnsResolver>) -> Self {
pub fn dns_resolver(mut self, dns_resolver: Box<dyn DnsResolver + Send + Sync>) -> Self {
self.0.dns_resolver = dns_resolver;
self
}
Expand Down Expand Up @@ -836,7 +836,7 @@ pub struct WantsTransportConfigClient {
dual_stack_config: Ipv6DualStackConfig,
tls_config: TlsClientConfig,
transport_config: quinn::TransportConfig,
dns_resolver: Box<dyn DnsResolver>,
dns_resolver: Box<dyn DnsResolver + Send + Sync>,
}

#[cfg(feature = "dangerous-configuration")]
Expand Down Expand Up @@ -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<Option<SocketAddr>>`,
/// indicating the result of the DNS resolution operation.
pub type DynFutureResolver = dyn Future<Output = std::io::Result<Option<SocketAddr>>>;
pub type DynFutureResolver = dyn Future<Output = std::io::Result<Option<SocketAddr>>> + Send;

/// A trait for asynchronously resolving domain names to IP addresses using DNS.
pub trait DnsResolver {
Expand Down
2 changes: 1 addition & 1 deletion wtransport/src/endpoint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ pub mod endpoint_side {
///
/// Use [`Endpoint::client`] to create and client-endpoint.
pub struct Client {
pub(super) dns_resolver: Box<dyn DnsResolver>,
pub(super) dns_resolver: Box<dyn DnsResolver + Send + Sync>,
}
}

Expand Down

0 comments on commit af0a7b4

Please sign in to comment.