From eddff99d97340468e4f3802ea15d080c6bee3994 Mon Sep 17 00:00:00 2001 From: Arqu Date: Fri, 1 Nov 2024 10:50:48 +0000 Subject: [PATCH] deploy: 1eb3f336eaba79c2501aa0390e0e39d86c488165 --- .../iroh_net_bench/enum.EndpointSelector.html | 4 +- .../iroh/fn.connect_client.html | 2 +- .../docs/iroh_net_bench/iroh/fn.server.html | 2 +- .../iroh/fn.server_endpoint.html | 2 +- pr/2878/docs/portmapper/index.html | 2 +- pr/2878/docs/portmapper/struct.Service.html | 4 +- pr/2878/docs/src/portmapper/lib.rs.html | 32 ++--------- pr/2878/docs/src/portmapper/upnp.rs.html | 57 ++++++++++++++----- 8 files changed, 56 insertions(+), 49 deletions(-) diff --git a/pr/2878/docs/iroh_net_bench/enum.EndpointSelector.html b/pr/2878/docs/iroh_net_bench/enum.EndpointSelector.html index 745500b6bf..ff04fb3c02 100644 --- a/pr/2878/docs/iroh_net_bench/enum.EndpointSelector.html +++ b/pr/2878/docs/iroh_net_bench/enum.EndpointSelector.html @@ -1,7 +1,7 @@ EndpointSelector in iroh_net_bench - Rust

Enum iroh_net_bench::EndpointSelector

source ·
pub enum EndpointSelector {
-    Iroh(Endpoint),
+    Iroh(Endpoint),
     Quinn(Endpoint),
-}

Variants§

§

Iroh(Endpoint)

§

Quinn(Endpoint)

Implementations§

source§

impl EndpointSelector

source

pub async fn close(self) -> Result<()>

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where +}

Variants§

§

Iroh(Endpoint)

§

Quinn(Endpoint)

Implementations§

source§

impl EndpointSelector

source

pub async fn close(self) -> Result<()>

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

§

fn implicit( diff --git a/pr/2878/docs/iroh_net_bench/iroh/fn.connect_client.html b/pr/2878/docs/iroh_net_bench/iroh/fn.connect_client.html index e440e4b78b..fa168191b6 100644 --- a/pr/2878/docs/iroh_net_bench/iroh/fn.connect_client.html +++ b/pr/2878/docs/iroh_net_bench/iroh/fn.connect_client.html @@ -2,5 +2,5 @@ server_addr: NodeAddr, relay_url: Option<RelayUrl>, opt: Opt -) -> Result<(Endpoint, Connection)>
Expand description

Create a client endpoint and client connection

+) -> Result<(Endpoint, Connection)>
Expand description

Create a client endpoint and client connection

\ No newline at end of file diff --git a/pr/2878/docs/iroh_net_bench/iroh/fn.server.html b/pr/2878/docs/iroh_net_bench/iroh/fn.server.html index cfacd00516..8a978024ab 100644 --- a/pr/2878/docs/iroh_net_bench/iroh/fn.server.html +++ b/pr/2878/docs/iroh_net_bench/iroh/fn.server.html @@ -1,2 +1,2 @@ -server in iroh_net_bench::iroh - Rust

Function iroh_net_bench::iroh::server

source ·
pub async fn server(endpoint: Endpoint, opt: Opt) -> Result<()>
Expand description

Take the provided endpoint and run the server

+server in iroh_net_bench::iroh - Rust

Function iroh_net_bench::iroh::server

source ·
pub async fn server(endpoint: Endpoint, opt: Opt) -> Result<()>
Expand description

Take the provided endpoint and run the server

\ No newline at end of file diff --git a/pr/2878/docs/iroh_net_bench/iroh/fn.server_endpoint.html b/pr/2878/docs/iroh_net_bench/iroh/fn.server_endpoint.html index aa3032746c..89f7367650 100644 --- a/pr/2878/docs/iroh_net_bench/iroh/fn.server_endpoint.html +++ b/pr/2878/docs/iroh_net_bench/iroh/fn.server_endpoint.html @@ -2,5 +2,5 @@ rt: &Runtime, relay_url: &Option<RelayUrl>, opt: &Opt -) -> (NodeAddr, Endpoint)
Expand description

Creates a server endpoint which runs on the given runtime

+) -> (NodeAddr, Endpoint)
Expand description

Creates a server endpoint which runs on the given runtime

\ No newline at end of file diff --git a/pr/2878/docs/portmapper/index.html b/pr/2878/docs/portmapper/index.html index a2d94115af..1c503b84f6 100644 --- a/pr/2878/docs/portmapper/index.html +++ b/pr/2878/docs/portmapper/index.html @@ -1,2 +1,2 @@ -portmapper - Rust

Crate portmapper

source ·
Expand description

Port mapping client and service.

+portmapper - Rust

Crate portmapper

source ·
Expand description

Port mapping client and service.

Structs§

\ No newline at end of file diff --git a/pr/2878/docs/portmapper/struct.Service.html b/pr/2878/docs/portmapper/struct.Service.html index ac805083f4..c90e6569cf 100644 --- a/pr/2878/docs/portmapper/struct.Service.html +++ b/pr/2878/docs/portmapper/struct.Service.html @@ -1,5 +1,5 @@ -Service in portmapper - Rust

Struct portmapper::Service

source ·
pub struct Service { /* private fields */ }
Expand description

A port mapping client.

-

Trait Implementations§

source§

impl Debug for Service

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where +Service in portmapper - Rust

Struct portmapper::Service

source ·
pub struct Service { /* private fields */ }
Expand description

A port mapping client.

+

Trait Implementations§

source§

impl Debug for Service

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

diff --git a/pr/2878/docs/src/portmapper/lib.rs.html b/pr/2878/docs/src/portmapper/lib.rs.html index a2aadfed9b..9c18f2a6dc 100644 --- a/pr/2878/docs/src/portmapper/lib.rs.html +++ b/pr/2878/docs/src/portmapper/lib.rs.html @@ -713,17 +713,6 @@ 713 714 715 -716 -717 -718 -719 -720 -721 -722 -723 -724 -725 -726
//! Port mapping client and service.
 
 use std::{
@@ -978,13 +967,10 @@
             inner: (enable_upnp && !upnp).then(|| {
                 Box::pin(async {
                     tracing::info!("upnp probe, sleeping");
-                    tokio::time::timeout(Duration::from_secs(3), async move {
-                        upnp::probe_available()
-                            .await
-                            .map(|addr| (addr, Instant::now()))
-                    })
-                    .await
-                })
+                    upnp::probe_available()
+                        .await
+                        .map(|addr| (addr, Instant::now()))
+                })
             }),
         };
 
@@ -1023,15 +1009,7 @@
             tokio::select! {
                 last_upnp_gateway_addr = &mut upnp_probing_task, if !upnp_done => {
                     trace!("tick: upnp probe ready");
-                    match last_upnp_gateway_addr {
-                        Ok(addr) => {
-                            probe.last_upnp_gateway_addr = addr;
-                        }
-                        Err(_err) => {
-                            probe.last_upnp_gateway_addr = None;
-                            tracing::debug!("upnp probe timed out");
-                        }
-                    }
+                    probe.last_upnp_gateway_addr = last_upnp_gateway_addr;
                     upnp_done = true;
                 },
                 last_nat_pmp = &mut nat_pmp_probing_task, if !nat_pmp_done => {
diff --git a/pr/2878/docs/src/portmapper/upnp.rs.html b/pr/2878/docs/src/portmapper/upnp.rs.html
index 8922ad5dc5..5346754a54 100644
--- a/pr/2878/docs/src/portmapper/upnp.rs.html
+++ b/pr/2878/docs/src/portmapper/upnp.rs.html
@@ -140,6 +140,21 @@
 140
 141
 142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
 
use std::{
     net::{Ipv4Addr, SocketAddrV4},
     num::NonZeroU16,
@@ -191,11 +206,15 @@
         let gateway = if let Some(known_gateway) = gateway {
             known_gateway
         } else {
-            aigd::tokio::search_gateway(igd_next::SearchOptions {
-                timeout: Some(SEARCH_TIMEOUT),
-                ..Default::default()
-            })
-            .await?
+            // Wrap in manual timeout, because igd_next doesn't respect the set timeout
+            tokio::time::timeout(
+                SEARCH_TIMEOUT,
+                aigd::tokio::search_gateway(igd_next::SearchOptions {
+                    timeout: Some(SEARCH_TIMEOUT),
+                    ..Default::default()
+                }),
+            )
+            .await??
         };
 
         let std::net::IpAddr::V4(external_ip) = gateway.get_external_ip().await? else {
@@ -268,18 +287,28 @@
 /// Searches for UPnP gateways.
 pub async fn probe_available() -> Option<Gateway> {
     inc!(Metrics, upnp_probes);
-    match aigd::tokio::search_gateway(igd_next::SearchOptions {
-        timeout: Some(SEARCH_TIMEOUT),
-        ..Default::default()
-    })
-    .await
-    {
-        Ok(gateway) => Some(gateway),
+
+    // Wrap in manual timeout, because igd_next doesn't respect the set timeout
+    let res = tokio::time::timeout(
+        SEARCH_TIMEOUT,
+        aigd::tokio::search_gateway(igd_next::SearchOptions {
+            timeout: Some(SEARCH_TIMEOUT),
+            ..Default::default()
+        }),
+    )
+    .await;
+
+    match res {
+        Ok(Ok(gateway)) => Some(gateway),
         Err(e) => {
+            inc!(Metrics, upnp_probes_failed);
+            debug!("upnp probe timed out: {e}");
+            None
+        }
+        Ok(Err(e)) => {
             inc!(Metrics, upnp_probes_failed);
             debug!("upnp probe failed: {e}");
             None
         }
     }
-}
-
\ No newline at end of file +}

\ No newline at end of file