Project

General

Profile

Bug #3326 » NFD_tlv_proposed.patch

Christian Kreuzberger, 11/10/2015 05:18 AM

View differences:

core/segment-publisher.hpp
void
publish()
{
ndn::EncodingBuffer buffer;
generate(buffer);
const uint8_t* rawBuffer = buffer.buf();
time::milliseconds now = ndn::time::toUnixTimestamp(ndn::time::system_clock::now());
// check how recently we have received information from generate()
if (now - m_lastGeneratedBuffer > m_freshnessPeriod)
{
m_encodingBuffer.reserve(0, false);
generate(m_encodingBuffer);
// update the timestamp
m_lastGeneratedBuffer = ndn::time::toUnixTimestamp(ndn::time::system_clock::now());
} // else: information should already be stored in m_encodingBuffer
const uint8_t* rawBuffer = m_encodingBuffer.buf();
const uint8_t* segmentBegin = rawBuffer;
const uint8_t* end = rawBuffer + buffer.size();
const uint8_t* end = rawBuffer + m_encodingBuffer.size();
Name segmentPrefix(m_prefix);
segmentPrefix.appendVersion();
......
virtual size_t
generate(ndn::EncodingBuffer& outBuffer) = 0;
time::milliseconds m_lastGeneratedBuffer;
ndn::EncodingBuffer m_encodingBuffer;
private:
void
publishSegment(shared_ptr<Data>& data)
rib/rib-manager.cpp
offset += block.size();
ndn::nfd::FaceStatus status(block);
activeFaces.insert(status.getFaceId());
try
{
ndn::nfd::FaceStatus status(block);
activeFaces.insert(status.getFaceId());
}
catch (const tlv::Error&)
{
std::cerr << "ERROR: cannot decode FaceStatus TLV" << std::endl;
return;
}
}
// Look for face IDs that were registered but not active to find missed
(2-2/2)