Skip to content

Commit

Permalink
util: avoid redundant sync interests when remote has missing nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
tianyuan129 committed Sep 2, 2024
1 parent 43abefa commit fce1297
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions ndn_python_repo/utils/passive_svs.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,13 @@ def sync_handler(self, name: FormalName, _param: InterestParam, _app_param: Bina
if len(diff) > 0:
self.logger.info(f'Remote missing nodes: {list(diff)}')
# Missing nodes may only exist in other nodes' sync interest,
# therefore we have to send all buffered sync interest out
# therefore we have to send all buffered sync interest out,
# unless they were sent before.
already_sent = []
for _, raw_inst in self.inst_buffer.items():
self.send_interest(raw_inst)
if raw_inst not in already_sent:
already_sent.append(raw_inst)
self.send_interest(raw_inst)
if need_fetch:
self.on_missing_data(self)

Expand Down

0 comments on commit fce1297

Please sign in to comment.