Skip to content

Commit e39e4a8

Browse files
insert relay path
1 parent 6c03522 commit e39e4a8

File tree

3 files changed

+28
-7
lines changed

3 files changed

+28
-7
lines changed

Cargo.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,6 @@ netwatch = { git = "https://github.com/n0-computer/net-tools", branch = "feat-mu
5151
# iroh-quinn-proto = { path = "../iroh-quinn/quinn-proto" }
5252
# iroh-quinn-udp = { path = "../iroh-quinn/quinn-udp" }
5353

54-
iroh-quinn = { git = "https://github.com//n0-computer/quinn", branch = "multipath-misc" }
55-
iroh-quinn-proto = { git = "https://github.com//n0-computer/quinn", branch = "multipath-misc" }
56-
iroh-quinn-udp = { git = "https://github.com//n0-computer/quinn", branch = "multipath-misc" }
54+
# iroh-quinn = { git = "https://github.com//n0-computer/quinn", branch = "multipath-misc" }
55+
# iroh-quinn-proto = { git = "https://github.com//n0-computer/quinn", branch = "multipath-misc" }
56+
# iroh-quinn-udp = { git = "https://github.com//n0-computer/quinn", branch = "multipath-misc" }

iroh/src/magicsock.rs

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,28 @@ impl MagicSock {
463463
}
464464
});
465465
}
466-
// TODO: add relay path as mapped addr
466+
// Insert the relay addr
467+
if let Some(addr) = self.get_mapping_addr(addr.node_id) {
468+
let conn = conn.clone();
469+
let addr = addr.private_socket_addr();
470+
task::spawn(async move {
471+
match conn
472+
.open_path(addr, quinn_proto::PathStatus::Available)
473+
.await
474+
{
475+
Ok(path) => {
476+
path.set_max_idle_timeout(Some(
477+
ENDPOINTS_FRESH_ENOUGH_DURATION,
478+
))
479+
.ok();
480+
path.set_keep_alive_interval(Some(HEARTBEAT_INTERVAL)).ok();
481+
}
482+
Err(err) => {
483+
warn!("failed to open path {:?}", err);
484+
}
485+
}
486+
});
487+
}
467488
} else {
468489
to_delete.push(i);
469490
}

0 commit comments

Comments
 (0)