Project

General

Profile

Feature #2734

Updated by Junxiao Shi over 9 years ago

SegmentFetcher::fetch SegmentFetcher.fetch uses a verifySegment callback which returns a true or false on verifying the Data validation result synchronously. packet signature.<br> 
 https://github.com/named-data/ndn-cxx/blob/f3cfab541d471b401ed02a5adaa9580446a01982/src/util/segment-fetcher.hpp#L138 

 But verifying a Data packet may require network operations to fetch certificates. 
 certificates to verify the signature. So, should verifySegment should be asynchronous, similar to Validator.validate. async like Validator.validate? Perhaps: 

     typedef function<void (const Data& data, const OnDataValidated& onValidated, const OnDataValidationFailed& onValidationFailed)> VerifySegment; 

 SegmentFetcher is a simple procedure that fetches one segment at a time. 
 To keep it simple, when verifySegment is in progress, the next segment need not be fetched.

Back