From 98d4b8a7b623922cdae78d64c01dedd4d6ac1537 Mon Sep 17 00:00:00 2001 From: OlivierHecart Date: Fri, 6 Sep 2024 17:51:23 +0200 Subject: [PATCH] Don't register current interests declaration replies --- zenoh/src/net/routing/hat/client/token.rs | 7 +++---- zenoh/src/net/routing/hat/p2p_peer/token.rs | 7 +++---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/zenoh/src/net/routing/hat/client/token.rs b/zenoh/src/net/routing/hat/client/token.rs index b6cde878b2..5014ee5931 100644 --- a/zenoh/src/net/routing/hat/client/token.rs +++ b/zenoh/src/net/routing/hat/client/token.rs @@ -116,10 +116,6 @@ fn declare_simple_token( interest_id: Option, send_declare: &mut SendDeclare, ) { - register_simple_token(tables, face, id, res); - - propagate_simple_token(tables, res, face, send_declare); - if let Some(interest_id) = interest_id { if let Some((interest, _)) = face.pending_current_interests.get(&interest_id) { let wire_expr = Resource::get_best_key(res, "", interest.src_face.id); @@ -137,6 +133,9 @@ fn declare_simple_token( ), ) } + } else { + register_simple_token(tables, face, id, res); + propagate_simple_token(tables, res, face, send_declare); } } diff --git a/zenoh/src/net/routing/hat/p2p_peer/token.rs b/zenoh/src/net/routing/hat/p2p_peer/token.rs index 1b84492848..a06b06f7e2 100644 --- a/zenoh/src/net/routing/hat/p2p_peer/token.rs +++ b/zenoh/src/net/routing/hat/p2p_peer/token.rs @@ -155,10 +155,6 @@ fn declare_simple_token( interest_id: Option, send_declare: &mut SendDeclare, ) { - register_simple_token(tables, face, id, res); - - propagate_simple_token(tables, res, face, send_declare); - if let Some(interest_id) = interest_id { if let Some((interest, _)) = face.pending_current_interests.get(&interest_id) { let wire_expr = Resource::get_best_key(res, "", interest.src_face.id); @@ -176,6 +172,9 @@ fn declare_simple_token( ), ) } + } else { + register_simple_token(tables, face, id, res); + propagate_simple_token(tables, res, face, send_declare); } }