Skip to content

Commit

Permalink
Compare locator Reliability even if not set
Browse files Browse the repository at this point in the history
  • Loading branch information
fuzzypixelz committed Sep 13, 2024
1 parent be26fe3 commit 4699952
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions zenoh/src/net/runtime/orchestrator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,7 @@ use zenoh_config::{
};
use zenoh_link::{Locator, LocatorInspector};
use zenoh_protocol::{
core::{
whatami::WhatAmIMatcher, EndPoint, Metadata, PriorityRange, Reliability, WhatAmI,
ZenohIdProto,
},
core::{whatami::WhatAmIMatcher, EndPoint, Metadata, PriorityRange, WhatAmI, ZenohIdProto},
scouting::{HelloProto, Scout, ScoutingBody, ScoutingMessage},
};
use zenoh_result::{bail, zerror, ZResult};
Expand Down Expand Up @@ -953,14 +950,13 @@ impl Runtime {
.metadata()
.get(Metadata::PRIORITIES)
.and_then(|p| PriorityRange::from_str(p).ok());
let reliability = locator
.metadata()
.get(Metadata::RELIABILITY)
.and_then(|r| Reliability::from_str(r).ok());
let reliability = inspector.is_reliable(locator).ok();
if !transport.as_ref().is_some_and(|t| {
t.get_links().is_ok_and(|ls| {
ls.iter()
.any(|l| l.priorities == priorities && l.reliability == reliability)
ls.iter().any(|l| {
l.priorities == priorities
&& inspector.is_reliable(&l.dst).ok() == reliability
})
})
}) {
if is_multicast {
Expand Down

0 comments on commit 4699952

Please sign in to comment.