From b8d159797cbf8e137f51898b56ba7b78e37c96a8 Mon Sep 17 00:00:00 2001 From: nazeh Date: Tue, 24 Sep 2024 20:28:10 +0300 Subject: [PATCH] wip(pkarr): add EndpointResolver --- pkarr/src/error.rs | 2 +- pkarr/src/extra/endpoints/endpoint.rs | 2 +- pkarr/src/extra/mod.rs | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 pkarr/src/extra/mod.rs diff --git a/pkarr/src/error.rs b/pkarr/src/error.rs index fda8f6b..1c2dbe2 100644 --- a/pkarr/src/error.rs +++ b/pkarr/src/error.rs @@ -62,7 +62,7 @@ pub enum Error { DhtIsShutdown, #[error("Publish query is already inflight for the same public_key")] - /// [crate::dht::Client::publish] is already inflight to the same public_key + /// [crate::Client::publish] is already inflight to the same public_key PublishInflight, #[error("SignedPacket's timestamp is not the most recent")] diff --git a/pkarr/src/extra/endpoints/endpoint.rs b/pkarr/src/extra/endpoints/endpoint.rs index 9cfb01b..738cc3c 100644 --- a/pkarr/src/extra/endpoints/endpoint.rs +++ b/pkarr/src/extra/endpoints/endpoint.rs @@ -20,7 +20,7 @@ pub struct Endpoint { impl Endpoint { /// 1. Find the SVCB or HTTPS records with the lowest priority /// 2. Choose a random one of the list of the above - /// 3. If the target is `.`, check A and AAAA records (https://www.rfc-editor.org/rfc/rfc9460#name-special-handling-of-in-targ) + /// 3. If the target is `.`, check A and AAAA records see [rfc9460](https://www.rfc-editor.org/rfc/rfc9460#name-special-handling-of-in-targ) pub(crate) fn find( signed_packet: &SignedPacket, target: &str, diff --git a/pkarr/src/extra/mod.rs b/pkarr/src/extra/mod.rs new file mode 100644 index 0000000..3aa2c45 --- /dev/null +++ b/pkarr/src/extra/mod.rs @@ -0,0 +1,2 @@ +#[cfg(feature = "endpoints")] +mod endpoints;