Skip to content

Commit

Permalink
Don't duplicate token declarations in linksstate peers for clients
Browse files Browse the repository at this point in the history
  • Loading branch information
OlivierHecart committed Aug 27, 2024
1 parent 0ecd745 commit 8175f1a
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions zenoh/src/net/routing/hat/linkstate_peer/token.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,16 @@ fn send_sourced_token_to_net_clildren(

#[inline]
fn propagate_simple_token_to(
_tables: &mut Tables,
tables: &mut Tables,
dst_face: &mut Arc<FaceState>,
res: &Arc<Resource>,
_src_face: &mut Arc<FaceState>,
src_face: &mut Arc<FaceState>,
send_declare: &mut SendDeclare,
) {
if !face_hat!(dst_face).local_tokens.contains_key(res) && dst_face.whatami == WhatAmI::Client {
if (src_face.id != dst_face.id || dst_face.zid == tables.zid)
&& !face_hat!(dst_face).local_tokens.contains_key(res)
&& dst_face.whatami == WhatAmI::Client
{
if dst_face.whatami != WhatAmI::Client {
let id = face_hat!(dst_face).next_id.fetch_add(1, Ordering::SeqCst);
face_hat_mut!(dst_face).local_tokens.insert(res.clone(), id);
Expand Down

0 comments on commit 8175f1a

Please sign in to comment.