mirror of
https://github.com/AleziaKurdis/overte.git
synced 2025-04-09 16:52:12 +02:00
CR fixes
This commit is contained in:
parent
2be828a84c
commit
1b31b8cff8
4 changed files with 9 additions and 15 deletions
|
@ -1737,7 +1737,7 @@ void DomainServer::nodePingMonitor() {
|
|||
if (lastHeard > 2 * USECS_PER_SECOND) {
|
||||
QString username;
|
||||
DomainServerNodeData* nodeData = static_cast<DomainServerNodeData*>(node->getLinkedData());
|
||||
if(nodeData) {
|
||||
if (nodeData) {
|
||||
username = nodeData->getUsername();
|
||||
}
|
||||
qCDebug(domain_server) << "Haven't heard from " << node->getPublicSocket() << username << " in " << lastHeard / USECS_PER_MSEC << " msec";
|
||||
|
|
|
@ -559,6 +559,8 @@ void DomainHandler::processDomainServerConnectionDeniedPacket(QSharedPointer<Rec
|
|||
}
|
||||
}
|
||||
|
||||
static const int SILENT_DOMAIN_TRAFFIC_DROP_MIN = 2;
|
||||
|
||||
bool DomainHandler::checkInPacketTimeout() {
|
||||
++_checkInPacketsSinceLastReply;
|
||||
|
||||
|
@ -568,7 +570,7 @@ bool DomainHandler::checkInPacketTimeout() {
|
|||
|
||||
auto nodeList = DependencyManager::get<NodeList>();
|
||||
|
||||
if(_checkInPacketsSinceLastReply > 2) {
|
||||
if (_checkInPacketsSinceLastReply > SILENT_DOMAIN_TRAFFIC_DROP_MIN) {
|
||||
qCDebug(networking_ice) << _checkInPacketsSinceLastReply << "seconds since last domain list request, squelching traffic";
|
||||
nodeList->setDropOutgoingNodeTraffic(true);
|
||||
}
|
||||
|
|
|
@ -409,9 +409,12 @@ qint64 LimitedNodeList::sendUnreliablePacket(const NLPacket& packet, const HifiS
|
|||
Q_ASSERT_X(!packet.isReliable(), "LimitedNodeList::sendUnreliablePacket",
|
||||
"Trying to send a reliable packet unreliably.");
|
||||
|
||||
if(_dropOutgoingNodeTraffic) {
|
||||
if (_dropOutgoingNodeTraffic) {
|
||||
auto destinationNode = findNodeWithAddr(sockAddr);
|
||||
if (!destinationNode.isNull() && (destinationNode->getType() != NodeType::DomainServer)) {
|
||||
|
||||
// findNodeWithAddr returns null for the address of the domain server
|
||||
if (!destinationNode.isNull()) {
|
||||
// This only suppresses individual unreliable packets, not unreliable packet lists
|
||||
return ERROR_SENDING_PACKET_BYTES;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -453,17 +453,6 @@ void NodeList::sendDomainServerCheckIn() {
|
|||
static const int MAX_CHECKINS_TOGETHER = 20;
|
||||
int outstandingCheckins = _domainHandler.getCheckInPacketsSinceLastReply();
|
||||
|
||||
/*
|
||||
static const int WARNING_CHECKIN_COUNT = 2;
|
||||
if (outstandingCheckins > WARNING_CHECKIN_COUNT) {
|
||||
// We may be headed for a disconnect, as we've written two DomainListRequests without getting anything back.
|
||||
// In some cases, we've found that nothing is going out on the wire despite not getting any errors from
|
||||
// sendPacket => writeDatagram, below. In at least some such cases, we've found that the DomainDisconnectRequest
|
||||
// does go through, so let's at least try to mix it up with a different safe packet.
|
||||
// TODO: send ICEPing, and later on tell the other nodes to shut up for a moment.
|
||||
|
||||
}*/
|
||||
|
||||
int checkinCount = outstandingCheckins > 1 ? std::pow(2, outstandingCheckins - 2) : 1;
|
||||
checkinCount = std::min(checkinCount, MAX_CHECKINS_TOGETHER);
|
||||
for (int i = 1; i < checkinCount; ++i) {
|
||||
|
|
Loading…
Reference in a new issue