Merge pull request #51 from huffman/tiemstamp-on-receive-packet-from-packetlist

Move lastHeardMicroStamp to be updated when filtering packets
This commit is contained in:
Stephen Birarda 2015-09-01 14:35:07 -06:00
commit 6e7db4e816
2 changed files with 4 additions and 12 deletions

View file

@ -234,6 +234,10 @@ bool LimitedNodeList::packetSourceAndHashMatch(const udt::Packet& packet) {
return false;
}
}
// No matter if this packet is handled or not, we update the timestamp for the last time we heard
// from this sending node
matchingNode->setLastHeardMicrostamp(usecTimestampNow());
return true;

View file

@ -258,12 +258,6 @@ void PacketReceiver::handleVerifiedPacketList(std::unique_ptr<udt::PacketList> p
if (!nlPacketList->getSourceID().isNull()) {
matchingNode = nodeList->nodeWithUUID(nlPacketList->getSourceID());
if (matchingNode) {
// No matter if this packet is handled or not, we update the timestamp for the last time we heard
// from this sending node
matchingNode->setLastHeardMicrostamp(usecTimestampNow());
}
}
QMutexLocker packetListenerLocker(&_packetListenerLock);
@ -384,12 +378,6 @@ void PacketReceiver::handleVerifiedPacket(std::unique_ptr<udt::Packet> packet) {
if (!nlPacket->getSourceID().isNull()) {
matchingNode = nodeList->nodeWithUUID(nlPacket->getSourceID());
if (matchingNode) {
// No matter if this packet is handled or not, we update the timestamp for the last time we heard
// from this sending node
matchingNode->setLastHeardMicrostamp(usecTimestampNow());
}
}
QMutexLocker packetListenerLocker(&_packetListenerLock);