add check of verification for content
Change-Id: If3404c76bb001fb65ebb9a231020bc7a319a0142
diff --git a/src/fetcher.cc b/src/fetcher.cc
index be9064a..8f78323 100644
--- a/src/fetcher.cc
+++ b/src/fetcher.cc
@@ -132,8 +132,8 @@
if (m_forwardingHint == Name ())
{
- // invoke callback
- if (!m_segmentCallback.empty ())
+ // check whether data is verified in this case; if verified invoke callback
+ if (!m_segmentCallback.empty () && data->verified())
{
m_segmentCallback (m_deviceName, m_name, seqno, data);
}
@@ -141,9 +141,12 @@
}
else
{
+ // in this case we don't care whether "data" is verified, in fact, we expect it is unverified
try {
PcoPtr pco = make_shared<ParsedContentObject> (*data->contentPtr ());
- if (!m_segmentCallback.empty ())
+
+ // we need to verify this pco and apply callback only when verified
+ if (!m_segmentCallback.empty () && m_ccnx->verifyPco(pco))
{
m_segmentCallback (m_deviceName, m_name, seqno, pco);
}