<div><div dir="auto">Hi Ashlesh</div></div><div><div class="gmail_quote"><div dir="ltr"><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div text="#000000" bgcolor="#FFFFFF">
<p>Observation in consumer application using ndn-cxx (0.6.3) segment fetcher to send an interest:</p>
<blockquote>
<p><font size="-1">1541784024.347425 DEBUG: [ndn.Face] <I /example/testApp?ndn.MustBeFresh=true&ndn.Nonce=2593228152<br>
1541784025.347404 DEBUG: [ndn.Face] <I /example/testApp?ndn.MustBeFresh=true&ndn.Nonce=1097587936 [This is sent by segment fetcher before timeout]<br>
1541784025.350393 DEBUG: [ndn.Face] >D /example/testApp/%00%00<br>
1541784025.350405 DEBUG: [ndn.Face]    satisfying /example/testApp?ndn.MustBeFresh=true&ndn.Nonce=2593228152 from app<br>
1541784025.350436 DEBUG: [ndn.security.v2.Validator] > Start validating data /example/testApp/%00%00<br>
1541784025.350441 TRACE: [ndn.security.v2.ValidationState] > Signature verification bypassed for data `/example/testApp/%00%00`<br>
Got data<br>
1541784025.350508 TRACE: [ndn.security.v2.ValidationState] ~ValidationState<br>
1541784025.350520 DEBUG: [ndn.Face]    satisfying /example/testApp?ndn.MustBeFresh=true&ndn.Nonce=1097587936 from app<br>
1541784025.350530 DEBUG: [ndn.security.v2.Validator] > Start validating data /example/testApp/%00%00<br>
1541784025.350533 TRACE: [ndn.security.v2.ValidationState] > Signature verification bypassed for data `/example/testApp/%00%00</font><br>
</p>
</blockquote>
<p>Why does ndn-cxx face consider two interests with same name and origin but different nonce as separate? An application will receive the same data packet twice.</p></div></blockquote><div dir="auto"><br></div><div dir="auto">I’m answering from ndn::Face point of view.</div><div dir="auto">Your application invokes Face::expressInterest twice. When the Data comes back, both callback functions are invoked. Face cannot know whether it’s the same part of the application expressing these two Interests (std::function objects are not comparable), so that the reasonable behavior is invoking both callbacks.</div><div dir="auto">If you don’t want the first callback to be invoked, cancel the first pending Interest when you express the second Interest. You may assign the return value of Face::expressInterest to a ScopedPendingInterest (to be implemented in <a href="https://redmine.named-data.net/issues/4316">https://redmine.named-data.net/issues/4316</a> ), so that only one pending Interest is alive.</div><div dir="auto"><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div text="#000000" bgcolor="#FFFFFF"><p><br>
</p>
<p>(Came up due to: <a class="m_-5079995824289583337moz-txt-link-freetext" href="https://redmine.named-data.net/issues/4770" target="_blank">
https://redmine.named-data.net/issues/4770</a>)</p></div></blockquote><div dir="auto"><br></div><div dir="auto">Yours, Junxiao</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div text="#000000" bgcolor="#FFFFFF"><p></p></div>
</blockquote></div></div>