Project

General

Profile

Task #2456

Simplify nfd-status using SegmentFetcher

Added by Alex Afanasyev over 4 years ago. Updated about 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Tools
Target version:
Start date:
Due date:
% Done:

100%

Estimated time:
6.00 h

Description

The code of nfd-status can be simplified by using SegmentFetcher from the library.

nfd-status.cpp (27.8 KB) nfd-status.cpp Yukai Tu, 05/25/2015 08:35 PM
20150627154553.tgz (131 KB) 20150627154553.tgz integ 2145,3 Junxiao Shi, 06/27/2015 09:35 AM
20150629175143.tgz (135 KB) 20150629175143.tgz integ 2145,5 Junxiao Shi, 06/29/2015 12:35 PM

History

#1 Updated by Teng Liang over 4 years ago

  • Assignee set to Teng Liang

#2 Updated by Junxiao Shi over 4 years ago

  • Estimated time set to 6.00 h

#3 Updated by Yukai Tu over 4 years ago

  • Status changed from New to In Progress
  • Assignee changed from Teng Liang to Yukai Tu

In SegmentFetcher, if data without finalBlockId, it will emit next Interest. In NfdStatus::fetchVersionInformation(), NfdStatus emit "/localhost/nfd/status", but statusServer doesn't have publisher, which means it can't set finalBlockId in Data, and it doesn't have second data. So it will fail to fetch "/localhost/nfd/status". Add setFinalBlockId in statusServer can solve the problem. Other fetch can be rewrited using SegmentFetcher successfully.

#4 Updated by Junxiao Shi over 4 years ago

ForwarderStatus is not StatusDataset, so fetching it is a simple Interest, not SegmentFetcher.

#5 Updated by Yukai Tu over 4 years ago

So we don't rewrite NfdStatus::fetchVersionInformation() using SegmentFetcher, just express one Interest?

#6 Updated by Junxiao Shi over 4 years ago

note-5 is correct. SegmentFetcher is only applicable to StatusDataset.

#7 Updated by Yukai Tu over 4 years ago

I have tested and it works, for you to review.

#8 Updated by Junxiao Shi over 4 years ago

Please submit a patchset to Gerrit for review.

#9 Updated by Junxiao Shi about 4 years ago

#10 Updated by Junxiao Shi about 4 years ago

#11 Updated by Alex Afanasyev about 4 years ago

  • Description updated (diff)

#12 Updated by Lan Wang about 4 years ago

Why isn't validation done in the code?

#13 Updated by Junxiao Shi about 4 years ago

Why isn't validation done in the code?

SegmentFetcher validation API is incomplete, see #2734.

There isn't a solution for how to obtain NFD's public key.

It should be an out-of-band method, such as reading from a file (owned by root, 0644 permission).

Also available in: Atom PDF