Skip to content

Commit

Permalink
change naming order to keep prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
divagant-martian committed May 21, 2024
1 parent 9be4c1c commit 373e172
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion iroh-net/src/discovery/dns.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ impl Discovery for DnsDiscovery {
let origin_domain = self.origin_domain.clone();
let fut = async move {
let node_addr = resolver
.staggered_lookup_by_id(&node_id, &origin_domain, DNS_STAGGERING_MS)
.lookup_by_id_staggered(&node_id, &origin_domain, DNS_STAGGERING_MS)
.await?;
Ok(DiscoveryItem {
provenance: "dns",
Expand Down
22 changes: 11 additions & 11 deletions iroh-net/src/dns.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ pub trait ResolverExt {
/// Perform an ipv4 lookup with a timeout in a staggered fashion.
///
/// The first call is done immediately, with added calls according to the staggering strategy.
fn staggered_lookup_ipv4<N: IntoName + Clone>(
fn lookup_ipv4_staggered<N: IntoName + Clone>(
&self,
host: N,
timeout: Duration,
Expand All @@ -124,7 +124,7 @@ pub trait ResolverExt {
/// Perform an ipv6 lookup with a timeout in a staggered fashion.
///
/// The first call is done immediately, with added calls according to the staggering strategy.
fn staggered_lookup_ipv6<N: IntoName + Clone>(
fn lookup_ipv6_staggered<N: IntoName + Clone>(
&self,
host: N,
timeout: Duration,
Expand All @@ -134,7 +134,7 @@ pub trait ResolverExt {
/// Race an ipv4 and ipv6 lookup with a timeout in a staggered fashion.
///
/// The first call is done immediately, with added calls according to the staggering strategy.
fn staggered_lookup_ipv4_ipv6<N: IntoName + Clone>(
fn lookup_ipv4_ipv6_staggered<N: IntoName + Clone>(
&self,
host: N,
timeout: Duration,
Expand All @@ -144,7 +144,7 @@ pub trait ResolverExt {
/// Looks up node info by DNS name in a staggered fashion.
///
/// The first call is done immediately, with added calls according to the staggering strategy.
fn staggered_lookup_by_name(
fn lookup_by_name_staggered(
&self,
name: &str,
delays_ms: &[u64],
Expand All @@ -153,7 +153,7 @@ pub trait ResolverExt {
/// Looks up node info by [`NodeId`] and origin domain name.
///
/// The first call is done immediately, with added calls according to the staggering strategy.
fn staggered_lookup_by_id(
fn lookup_by_id_staggered(
&self,
node_id: &NodeId,
origin: &str,
Expand Down Expand Up @@ -227,7 +227,7 @@ impl ResolverExt for DnsResolver {
///
/// The first call is done immediately, with added calls according to the staggering strategy.
/// The timeout is passed to every individual call to [`ResolverExt::lookup_ipv4`].
async fn staggered_lookup_ipv4<N: IntoName + Clone>(
async fn lookup_ipv4_staggered<N: IntoName + Clone>(
&self,
host: N,
timeout: Duration,
Expand All @@ -241,7 +241,7 @@ impl ResolverExt for DnsResolver {
///
/// The first call is done immediately, with added calls according to the staggering strategy.
/// The timeout is passed to every individual call to [`ResolverExt::lookup_ipv6`].
async fn staggered_lookup_ipv6<N: IntoName + Clone>(
async fn lookup_ipv6_staggered<N: IntoName + Clone>(
&self,
host: N,
timeout: Duration,
Expand All @@ -255,7 +255,7 @@ impl ResolverExt for DnsResolver {
///
/// The first call is done immediately, with added calls according to the staggering strategy.
/// The timeout is passed to every individual call to [`ResolverExt::lookup_ipv4_ipv6`].
async fn staggered_lookup_ipv4_ipv6<N: IntoName + Clone>(
async fn lookup_ipv4_ipv6_staggered<N: IntoName + Clone>(
&self,
host: N,
timeout: Duration,
Expand All @@ -268,15 +268,15 @@ impl ResolverExt for DnsResolver {
/// Looks up node info by DNS name in a staggered fashion.
///
/// The first call is done immediately, with added calls according to the staggering strategy.
async fn staggered_lookup_by_name(&self, name: &str, delays_ms: &[u64]) -> Result<NodeAddr> {
async fn lookup_by_name_staggered(&self, name: &str, delays_ms: &[u64]) -> Result<NodeAddr> {
let f = || self.lookup_by_name(name);
stagger_call(f, delays_ms).await
}

/// Looks up node info by [`NodeId`] and origin domain name.
///
/// The first call is done immediately, with added calls according to the staggering strategy.
async fn staggered_lookup_by_id(
async fn lookup_by_id_staggered(
&self,
node_id: &NodeId,
origin: &str,
Expand Down Expand Up @@ -370,7 +370,7 @@ pub(crate) mod tests {
let _logging = iroh_test::logging::setup();
let resolver = default_resolver();
let res: Vec<_> = resolver
.staggered_lookup_ipv4_ipv6(NA_RELAY_HOSTNAME, TIMEOUT, STAGGERING_DELAYS)
.lookup_ipv4_ipv6_staggered(NA_RELAY_HOSTNAME, TIMEOUT, STAGGERING_DELAYS)
.await
.unwrap()
.collect();
Expand Down
4 changes: 2 additions & 2 deletions iroh-net/src/netcheck/reportgen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -949,7 +949,7 @@ async fn get_relay_addr(
Some(url::Host::Domain(hostname)) => {
debug!(?proto, %hostname, "Performing DNS A lookup for relay addr");
match dns_resolver
.staggered_lookup_ipv4(hostname, DNS_TIMEOUT, DNS_STAGGERING_MS)
.lookup_ipv4_staggered(hostname, DNS_TIMEOUT, DNS_STAGGERING_MS)
.await
{
Ok(mut addrs) => addrs
Expand All @@ -969,7 +969,7 @@ async fn get_relay_addr(
Some(url::Host::Domain(hostname)) => {
debug!(?proto, %hostname, "Performing DNS AAAA lookup for relay addr");
match dns_resolver
.staggered_lookup_ipv6(hostname, DNS_TIMEOUT, DNS_STAGGERING_MS)
.lookup_ipv6_staggered(hostname, DNS_TIMEOUT, DNS_STAGGERING_MS)
.await
{
Ok(mut addrs) => addrs
Expand Down

0 comments on commit 373e172

Please sign in to comment.