-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Origin/local #3
base: local
Are you sure you want to change the base?
Origin/local #3
Conversation
#include <list> | ||
#include <iostream> | ||
|
||
// #include <list> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not just remove?
@@ -225,13 +211,11 @@ ServiceDiscovery::sendData(const ndn::Name& name) | |||
auto timeDiff = ndn::time::system_clock::now() - m_producerState.publishTimestamp; | |||
auto timeToExpire = ndn::time::duration_cast<ndn::time::seconds>(timeDiff); | |||
|
|||
int status = (timeToExpire > m_producerState.serviceLifetime) ? EXPIRED : ACTIVE; | |||
m_serviceStatus = (timeToExpire > m_producerState.serviceLifetime) ? EXPIRED : ACTIVE; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move lines 211-214 to wireEncode too.
And you need to still have a local variable serviceStatus
and then check with global variable. Otherwise no need to wireEncode again.
totalLength += encoder.prependVarNumber(totalLength); | ||
totalLength += encoder.prependVarNumber(tlv::DiscoveryData); | ||
|
||
return totalLength; | ||
} | ||
|
||
const ndn::Block& | ||
ServiceDiscovery::wireEncode(const std::string& info, int status) | ||
ServiceDiscovery::wireEncode() | ||
{ | ||
if (m_wire.hasWire()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If hasWire, you should simply resend. The below string should be saved in a class member and then reset wire when this string is modified/updated.
@@ -375,19 +384,17 @@ ServiceDiscovery::wireDecode(const ndn::Block& wire) | |||
} | |||
|
|||
wire.parse(); | |||
m_wire = wire; | |||
ndn::Block::element_const_iterator it = wire.elements_begin(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
auto
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still don't understand why pFlags are passed as std::map<char, uint8_t> instead of something like:
https://github.com/named-data/ndn-cxx/blob/master/ndn-cxx/util/segment-fetcher.hpp#L114
(ctor: https://github.com/named-data/ndn-cxx/blob/master/ndn-cxx/util/segment-fetcher.hpp#L164)
No description provided.