Skip to content

Commit

Permalink
chore(sip-core): update dns & thiserror
Browse files Browse the repository at this point in the history
  • Loading branch information
kbalt committed Dec 2, 2024
1 parent f0aa264 commit 38a16d4
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 14 deletions.
4 changes: 2 additions & 2 deletions crates/sip-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ tokio-util = { version = "0.7", features = ["codec"] }
tokio-stream = "0.1"
async-trait = "0.1"
log = "0.4"
thiserror = "1"
thiserror = "2"
parking_lot = "0.12"
rand = "0.8"
bytesstr = "1"
downcast-rs = "1"
trust-dns-resolver = "0.23"
hickory-resolver = "0.24"
multimap = "0.10"
nom = "7"

Expand Down
2 changes: 1 addition & 1 deletion crates/sip-core/src/endpoint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@ impl EndpointBuilder {
/// Set a `trust-dns-resolver` DNS resolver for the endpoint to use.
///
/// Uses the system config by default.
pub fn set_dns_resolver(&mut self, dns_resolver: trust_dns_resolver::TokioAsyncResolver) {
pub fn set_dns_resolver(&mut self, dns_resolver: hickory_resolver::TokioAsyncResolver) {
self.transports.set_dns_resolver(dns_resolver)
}

Expand Down
11 changes: 4 additions & 7 deletions crates/sip-core/src/transport/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ pub(crate) struct Transports {

stun: StunEndpoint<StunUser>,

dns_resolver: trust_dns_resolver::TokioAsyncResolver,
dns_resolver: hickory_resolver::TokioAsyncResolver,
}

impl Transports {
Expand Down Expand Up @@ -561,7 +561,7 @@ impl Transports {
pub(crate) struct TransportsBuilder {
unmanaged: Vec<TpHandle>,
factories: Vec<Arc<dyn Factory>>,
dns_resolver: Option<trust_dns_resolver::TokioAsyncResolver>,
dns_resolver: Option<hickory_resolver::TokioAsyncResolver>,
}

impl TransportsBuilder {
Expand All @@ -575,16 +575,13 @@ impl TransportsBuilder {
self.factories.push(factory);
}

pub(crate) fn set_dns_resolver(
&mut self,
dns_resolver: trust_dns_resolver::TokioAsyncResolver,
) {
pub(crate) fn set_dns_resolver(&mut self, dns_resolver: hickory_resolver::TokioAsyncResolver) {
self.dns_resolver = Some(dns_resolver);
}

pub(crate) fn build(&mut self) -> Transports {
let dns_resolver = self.dns_resolver.take().unwrap_or_else(|| {
trust_dns_resolver::TokioAsyncResolver::tokio_from_system_conf()
hickory_resolver::TokioAsyncResolver::tokio_from_system_conf()
.expect("Failed to create default system DNS resolver")
});

Expand Down
8 changes: 4 additions & 4 deletions crates/sip-core/src/transport/resolver.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
use hickory_resolver::error::{ResolveError, ResolveErrorKind};
use hickory_resolver::proto::rr::rdata::{NAPTR, SRV};
use hickory_resolver::proto::rr::{RData, RecordType};
use hickory_resolver::{Name, TokioAsyncResolver};
use multimap::MultiMap;
use std::io;
use std::net::{IpAddr, SocketAddr};
use trust_dns_resolver::error::{ResolveError, ResolveErrorKind};
use trust_dns_resolver::proto::rr::rdata::{NAPTR, SRV};
use trust_dns_resolver::proto::rr::{RData, RecordType};
use trust_dns_resolver::{Name, TokioAsyncResolver};

#[derive(Debug, Clone, Copy)]
pub(super) struct ServerEntry {
Expand Down

0 comments on commit 38a16d4

Please sign in to comment.