From 535f66117b097368420899ca742569c48c3184c4 Mon Sep 17 00:00:00 2001 From: OlivierHecart Date: Thu, 19 Dec 2024 12:29:57 +0100 Subject: [PATCH] homogenize --- zenoh/src/net/routing/hat/p2p_peer/gossip.rs | 10 +++++----- zenoh/src/net/routing/hat/p2p_peer/mod.rs | 6 +----- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/zenoh/src/net/routing/hat/p2p_peer/gossip.rs b/zenoh/src/net/routing/hat/p2p_peer/gossip.rs index 715ab0d1d..b0b382eef 100644 --- a/zenoh/src/net/routing/hat/p2p_peer/gossip.rs +++ b/zenoh/src/net/routing/hat/p2p_peer/gossip.rs @@ -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, @@ -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 { @@ -132,7 +132,7 @@ impl Network { router_peers_failover_brokering, gossip, gossip_multihop, - target, + gossip_target, autoconnect, wait_declares, idx, @@ -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); @@ -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); diff --git a/zenoh/src/net/routing/hat/p2p_peer/mod.rs b/zenoh/src/net/routing/hat/p2p_peer/mod.rs index 4b5d727b5..429231f3c 100644 --- a/zenoh/src/net/routing/hat/p2p_peer/mod.rs +++ b/zenoh/src/net/routing/hat/p2p_peer/mod.rs @@ -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 {