table: ContentStore recognizes CachingPolicy-NoCache

refs #2185

Change-Id: Id3dab8936c4dafc96c5d8933d7e75c6cc2e31ff2
diff --git a/daemon/table/cs.cpp b/daemon/table/cs.cpp
index e1e8e73..2226335 100644
--- a/daemon/table/cs.cpp
+++ b/daemon/table/cs.cpp
@@ -63,6 +63,16 @@
 {
   NFD_LOG_DEBUG("insert " << data.getName());
 
+  // recognize CachingPolicy
+  using ndn::nfd::LocalControlHeader;
+  const LocalControlHeader& lch = data.getLocalControlHeader();
+  if (lch.hasCachingPolicy()) {
+    LocalControlHeader::CachingPolicy policy = lch.getCachingPolicy();
+    if (policy == LocalControlHeader::CachingPolicy::NO_CACHE) {
+      return false;
+    }
+  }
+
   bool isNewEntry = false; TableIt it;
   // use .insert because gcc46 does not support .emplace
   std::tie(it, isNewEntry) = m_table.insert(EntryImpl(data.shared_from_this(), isUnsolicited));