Skip to content

Commit

Permalink
File name fix
Browse files Browse the repository at this point in the history
  • Loading branch information
sankalpatimilsina12 committed Aug 30, 2024
1 parent 3306ac8 commit 6f7db81
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ndn_hydra/repo/handles/insert_command_handle.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ async def _process_insert(self, cmd: InsertCommand):
add_message.node_name = self.config['node_name'].encode()
add_message.favor = str(favor).encode()
add_message.file = File()
add_message.file.file_name = cmd.file.file_name[-2:]
add_message.file.file_name = cmd.file.file_name
add_message.file.packets = packets
add_message.file.packet_size = packet_size
add_message.file.size = size
Expand Down
3 changes: 2 additions & 1 deletion ndn_hydra/repo/handles/read_handle.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def _on_interest(self, int_name, int_param, _app_param):
best_id = self._best_id_for_file(file_name)
segment_comp = "/" + Component.to_str(int_name[-1])

if int_param.must_be_fresh and segment_comp != "/seg=0":
if int_param.must_be_fresh:
return

if best_id is None:
Expand Down Expand Up @@ -120,6 +120,7 @@ def _get_file_name_from_interest(self, int_name):

def _best_id_for_file(self, file_name: str):
file_info = self.global_view.get_file(file_name)
print(file_info)
if not file_name or not file_info:
return None
active_nodes = set( [x['node_name'] for x in self.global_view.get_nodes()] )
Expand Down

0 comments on commit 6f7db81

Please sign in to comment.