From a9e143d0f5389cd8fe35051201030d2a911a4e72 Mon Sep 17 00:00:00 2001 From: Jeff Thompson Date: Mon, 18 Mar 2019 11:42:06 -0700 Subject: [PATCH] FullProducerArbitrary: In publishName, do nothing if the name is already published. --- PSync/full-producer-arbitrary.cpp | 5 +++++ PSync/full-producer-arbitrary.hpp | 1 + 2 files changed, 6 insertions(+) diff --git a/PSync/full-producer-arbitrary.cpp b/PSync/full-producer-arbitrary.cpp index 4b897c4..3466e31 100644 --- a/PSync/full-producer-arbitrary.cpp +++ b/PSync/full-producer-arbitrary.cpp @@ -71,6 +71,11 @@ FullProducerArbitrary::~FullProducerArbitrary() void FullProducerArbitrary::publishName(const ndn::Name& name) { + if (m_name2hash.find(name) != m_name2hash.end()) { + NDN_LOG_DEBUG("Already published, ignoring: " << name); + return; + } + NDN_LOG_INFO("Publish: " << name); insertToIBF(name); diff --git a/PSync/full-producer-arbitrary.hpp b/PSync/full-producer-arbitrary.hpp index f784374..4843295 100644 --- a/PSync/full-producer-arbitrary.hpp +++ b/PSync/full-producer-arbitrary.hpp @@ -99,6 +99,7 @@ class FullProducerArbitrary : public ProducerBase /** * @brief Publish name to let others know * + * However, if the name has already been published, do nothing. * @param name the Name to be updated */ void