Skip to content

Commit

Permalink
FullProducerArbitrary: In publishName, do nothing if the name is alre…
Browse files Browse the repository at this point in the history
…ady published.
  • Loading branch information
jefft0 authored and agawande committed Jul 13, 2019
1 parent f572186 commit a9e143d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions PSync/full-producer-arbitrary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions PSync/full-producer-arbitrary.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a9e143d

Please sign in to comment.