Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ unused-async = "warn"


[patch.crates-io]
n0-watcher = { git = "https://github.com/n0-computer/n0-watcher", branch = "feat-get-ref" }

iroh-quinn = { git = "https://github.com/n0-computer/quinn", branch = "main-iroh" }
iroh-quinn-proto = { git = "https://github.com/n0-computer/quinn", branch = "main-iroh" }
iroh-quinn-udp = { git = "https://github.com/n0-computer/quinn", branch = "main-iroh" }
Expand Down
2 changes: 1 addition & 1 deletion iroh/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ iroh-base = { version = "0.95.1", default-features = false, features = ["key", "
iroh-relay = { version = "0.95", path = "../iroh-relay", default-features = false }
n0-future = "0.3.0"
n0-error = "0.1.0"
n0-watcher = "0.5"
n0-watcher = "0.6"
netwatch = { version = "0.12" }
pin-project = "1"
pkarr = { version = "5", default-features = false, features = ["relays"] }
Expand Down
2 changes: 1 addition & 1 deletion iroh/src/magicsock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ impl MagicSock {

#[cfg_attr(windows, allow(dead_code))]
fn normalized_local_addr(&self) -> io::Result<SocketAddr> {
let addrs = self.local_addrs_watch.get_ref();
let addrs = self.local_addrs_watch.peek();

let mut ipv4_addr = None;
for addr in addrs {
Expand Down
29 changes: 15 additions & 14 deletions iroh/src/magicsock/endpoint_map/endpoint_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1146,20 +1146,21 @@ impl PathsWatchable {
&self,
conn_handle: WeakConnectionHandle,
) -> impl Watcher<Value = PathInfoList> + Unpin + Send + Sync + 'static {
let joined_watcher = (self.open_paths.watch(), self.selected_path.watch());
joined_watcher.map(move |(open_paths, selected_path)| {
let selected_path: Option<TransportAddr> = selected_path.map(Into::into);
let Some(conn) = conn_handle.upgrade() else {
return PathInfoList(Default::default());
};
let list = open_paths
.into_iter()
.flat_map(move |(remote, path_id)| {
PathInfo::new(path_id, &conn, remote, selected_path.as_ref())
})
.collect();
PathInfoList(list)
})
self.open_paths.watch().or(self.selected_path.watch()).map(
move |(open_paths, selected_path)| {
let selected_path: Option<TransportAddr> = selected_path.map(Into::into);
let Some(conn) = conn_handle.upgrade() else {
return PathInfoList(Default::default());
};
let list = open_paths
.into_iter()
.flat_map(move |(remote, path_id)| {
PathInfo::new(path_id, &conn, remote, selected_path.as_ref())
})
.collect();
PathInfoList(list)
},
)
}
}

Expand Down
6 changes: 3 additions & 3 deletions iroh/src/magicsock/transports.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ pub(crate) struct Transports {

#[cfg(not(wasm_browser))]
pub(crate) type LocalAddrsWatch = n0_watcher::Map<
(
n0_watcher::Tuple<
n0_watcher::Join<SocketAddr, n0_watcher::Direct<SocketAddr>>,
n0_watcher::Join<
Option<(RelayUrl, EndpointId)>,
n0_watcher::Map<n0_watcher::Direct<Option<RelayUrl>>, Option<(RelayUrl, EndpointId)>>,
>,
),
>,
Vec<Addr>,
>;

Expand Down Expand Up @@ -155,7 +155,7 @@ impl Transports {
let ips = n0_watcher::Join::new(self.ip.iter().map(|t| t.local_addr_watch()));
let relays = n0_watcher::Join::new(self.relay.iter().map(|t| t.local_addr_watch()));

(ips, relays).map(|(ips, relays)| {
ips.or(relays).map(|(ips, relays)| {
ips.into_iter()
.map(Addr::from)
.chain(
Expand Down
Loading