Make nonce optional in packet format v0.3 encoding
Packets are encoded as v0.3 if the parameters element is present, but getNonce() still generates a nonce if there is none. In v0.3, nonce is optional, so this issue is to stop creating a nonce if none was set. This is part of Packet03Transition.
Updated by Davide Pesavento 9 months ago
- % Done changed from 0 to 30
https://gerrit.named-data.net/c/ndn-cxx/+/5723 This is the first step: no longer force the generation of a nonce during decoding if the Interest doesn't contain one. The packet spec v0.3 says:
Nonce is required when an Interest is transmitted over the network links, i.e., a compliant forwarder must augment the Interest with the Nonce element if it is missing.
I'm assuming NFD calls
getNonce() at some point before forwarding an Interest. If that's the case,
getNonce will invalidate the cached encoding and this will trigger a re-encode with the generated nonce when the Interest is sent. Otherwise, we need to force nonce generation in NFD somehow.