Skip to content

Commit

Permalink
homogenize
Browse files Browse the repository at this point in the history
  • Loading branch information
OlivierHecart committed Dec 19, 2024
1 parent cb5f0c2 commit 535f661
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
10 changes: 5 additions & 5 deletions zenoh/src/net/routing/hat/p2p_peer/gossip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ pub(super) struct Network {
pub(super) router_peers_failover_brokering: bool,
pub(super) gossip: bool,
pub(super) gossip_multihop: bool,
pub(super) target: WhatAmIMatcher,
pub(super) gossip_target: WhatAmIMatcher,
pub(super) autoconnect: WhatAmIMatcher,
pub(super) wait_declares: bool,
pub(super) idx: NodeIndex,
Expand All @@ -114,7 +114,7 @@ impl Network {
router_peers_failover_brokering: bool,
gossip: bool,
gossip_multihop: bool,
target: WhatAmIMatcher,
gossip_target: WhatAmIMatcher,
autoconnect: WhatAmIMatcher,
wait_declares: bool,
) -> Self {
Expand All @@ -132,7 +132,7 @@ impl Network {
router_peers_failover_brokering,
gossip,
gossip_multihop,
target,
gossip_target,
autoconnect,
wait_declares,
idx,
Expand Down Expand Up @@ -236,7 +236,7 @@ impl Network {
fn send_on_link(&self, idxs: Vec<(NodeIndex, Details)>, transport: &TransportUnicast) {
if transport
.get_whatami()
.is_ok_and(|w| self.target.matches(w))
.is_ok_and(|w| self.gossip_target.matches(w))
{
if let Ok(msg) = self.make_msg(idxs) {
tracing::trace!("{} Send to {:?} {:?}", self.name, transport.get_zid(), msg);
Expand All @@ -258,7 +258,7 @@ impl Network {
if link
.transport
.get_whatami()
.is_ok_and(|w| self.target.matches(w))
.is_ok_and(|w| self.gossip_target.matches(w))
&& parameters(link)
{
tracing::trace!("{} Send to {} {:?}", self.name, link.zid, msg);
Expand Down
6 changes: 1 addition & 5 deletions zenoh/src/net/routing/hat/p2p_peer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,7 @@ impl HatBaseTrait for HatCode {
let whatami = tables.whatami;
let gossip = unwrap_or_default!(config.scouting().gossip().enabled());
let gossip_multihop = unwrap_or_default!(config.scouting().gossip().multihop());
let gossip_target = if gossip {
*unwrap_or_default!(config.scouting().gossip().target().get(whatami))
} else {
WhatAmIMatcher::empty()
};
let gossip_target = *unwrap_or_default!(config.scouting().gossip().target().get(whatami));
let autoconnect = if gossip {
*unwrap_or_default!(config.scouting().gossip().autoconnect().get(whatami))
} else {
Expand Down

0 comments on commit 535f661

Please sign in to comment.