mirror of
https://github.com/lubosz/overte.git
synced 2025-08-07 18:21:16 +02:00
When missing domain checkins, drop packets not destined for DS
This commit is contained in:
parent
91dce827a5
commit
3d2b1dbf2b
4 changed files with 19 additions and 2 deletions
|
@ -566,9 +566,14 @@ bool DomainHandler::checkInPacketTimeout() {
|
||||||
qCDebug(networking_ice) << "Silent domain checkins:" << _checkInPacketsSinceLastReply;
|
qCDebug(networking_ice) << "Silent domain checkins:" << _checkInPacketsSinceLastReply;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_checkInPacketsSinceLastReply > MAX_SILENT_DOMAIN_SERVER_CHECK_INS) {
|
auto nodeList = DependencyManager::get<NodeList>();
|
||||||
|
|
||||||
auto nodeList = DependencyManager::get<NodeList>();
|
if(_checkInPacketsSinceLastReply > 2) {
|
||||||
|
qCDebug(networking_ice) << _checkInPacketsSinceLastReply << "seconds since last domain list request, squelching traffic";
|
||||||
|
nodeList->setDropOutgoingNodeTraffic(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_checkInPacketsSinceLastReply > MAX_SILENT_DOMAIN_SERVER_CHECK_INS) {
|
||||||
|
|
||||||
// we haven't heard back from DS in MAX_SILENT_DOMAIN_SERVER_CHECK_INS
|
// we haven't heard back from DS in MAX_SILENT_DOMAIN_SERVER_CHECK_INS
|
||||||
// so emit our signal that says that
|
// so emit our signal that says that
|
||||||
|
|
|
@ -409,6 +409,13 @@ qint64 LimitedNodeList::sendUnreliablePacket(const NLPacket& packet, const HifiS
|
||||||
Q_ASSERT_X(!packet.isReliable(), "LimitedNodeList::sendUnreliablePacket",
|
Q_ASSERT_X(!packet.isReliable(), "LimitedNodeList::sendUnreliablePacket",
|
||||||
"Trying to send a reliable packet unreliably.");
|
"Trying to send a reliable packet unreliably.");
|
||||||
|
|
||||||
|
if(_dropOutgoingNodeTraffic) {
|
||||||
|
auto destinationNode = findNodeWithAddr(sockAddr);
|
||||||
|
if (!destinationNode.isNull() && (destinationNode->getType() != NodeType::DomainServer)) {
|
||||||
|
return ERROR_SENDING_PACKET_BYTES;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fillPacketHeader(packet, hmacAuth);
|
fillPacketHeader(packet, hmacAuth);
|
||||||
|
|
||||||
return _nodeSocket.writePacket(packet, sockAddr);
|
return _nodeSocket.writePacket(packet, sockAddr);
|
||||||
|
|
|
@ -335,6 +335,8 @@ public:
|
||||||
float getInboundKbps() const { return _inboundKbps; }
|
float getInboundKbps() const { return _inboundKbps; }
|
||||||
float getOutboundKbps() const { return _outboundKbps; }
|
float getOutboundKbps() const { return _outboundKbps; }
|
||||||
|
|
||||||
|
void setDropOutgoingNodeTraffic(bool squelchOutgoingNodeTraffic) { _dropOutgoingNodeTraffic = squelchOutgoingNodeTraffic; }
|
||||||
|
|
||||||
const std::set<NodeType_t> SOLO_NODE_TYPES = {
|
const std::set<NodeType_t> SOLO_NODE_TYPES = {
|
||||||
NodeType::AvatarMixer,
|
NodeType::AvatarMixer,
|
||||||
NodeType::AudioMixer,
|
NodeType::AudioMixer,
|
||||||
|
@ -493,6 +495,8 @@ private:
|
||||||
int _outboundPPS { 0 };
|
int _outboundPPS { 0 };
|
||||||
float _inboundKbps { 0.0f };
|
float _inboundKbps { 0.0f };
|
||||||
float _outboundKbps { 0.0f };
|
float _outboundKbps { 0.0f };
|
||||||
|
|
||||||
|
bool _dropOutgoingNodeTraffic { false };
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // hifi_LimitedNodeList_h
|
#endif // hifi_LimitedNodeList_h
|
||||||
|
|
|
@ -710,6 +710,7 @@ void NodeList::processDomainServerList(QSharedPointer<ReceivedMessage> message)
|
||||||
|
|
||||||
// this is a packet from the domain server, reset the count of un-replied check-ins
|
// this is a packet from the domain server, reset the count of un-replied check-ins
|
||||||
_domainHandler.clearPendingCheckins();
|
_domainHandler.clearPendingCheckins();
|
||||||
|
setDropOutgoingNodeTraffic(false);
|
||||||
|
|
||||||
// emit our signal so listeners know we just heard from the DS
|
// emit our signal so listeners know we just heard from the DS
|
||||||
emit receivedDomainServerList();
|
emit receivedDomainServerList();
|
||||||
|
|
Loading…
Reference in a new issue