diff --git a/assignment-client/src/assets/AssetServer.cpp b/assignment-client/src/assets/AssetServer.cpp index e7d86c824e..ca0f222e0c 100644 --- a/assignment-client/src/assets/AssetServer.cpp +++ b/assignment-client/src/assets/AssetServer.cpp @@ -50,9 +50,9 @@ static const int INTERFACE_RUNNING_CHECK_FREQUENCY_MS = 1000; const QString ASSET_SERVER_LOGGING_TARGET_NAME = "asset-server"; -static const QStringList BAKEABLE_MODEL_EXTENSIONS = {"fbx"}; +static const QStringList BAKEABLE_MODEL_EXTENSIONS = { "fbx" }; static QStringList BAKEABLE_TEXTURE_EXTENSIONS; -static const QStringList BAKEABLE_SCRIPT_EXTENSIONS = {"js"}; +static const QStringList BAKEABLE_SCRIPT_EXTENSIONS = {}; static const QString BAKED_MODEL_SIMPLE_NAME = "asset.fbx"; static const QString BAKED_TEXTURE_SIMPLE_NAME = "texture.ktx"; static const QString BAKED_SCRIPT_SIMPLE_NAME = "asset.js"; diff --git a/domain-server/src/DomainServer.cpp b/domain-server/src/DomainServer.cpp index 7b0b709bf7..c2fe3af7c1 100644 --- a/domain-server/src/DomainServer.cpp +++ b/domain-server/src/DomainServer.cpp @@ -830,26 +830,6 @@ void DomainServer::setupICEHeartbeatForFullNetworking() { void DomainServer::updateICEServerAddresses() { if (_iceAddressLookupID == INVALID_ICE_LOOKUP_ID) { _iceAddressLookupID = QHostInfo::lookupHost(_iceServerAddr, this, SLOT(handleICEHostInfo(QHostInfo))); - - // there seems to be a 5.9 bug where lookupHost never calls our slot - // so we add a single shot manual "timeout" to fire it off again if it hasn't called back yet - static const int ICE_ADDRESS_LOOKUP_TIMEOUT_MS = 5000; - QTimer::singleShot(ICE_ADDRESS_LOOKUP_TIMEOUT_MS, this, &DomainServer::timeoutICEAddressLookup); - } -} - -void DomainServer::timeoutICEAddressLookup() { - if (_iceAddressLookupID != INVALID_ICE_LOOKUP_ID) { - // we waited 5s and didn't hear back for our ICE DNS lookup - // so time that one out and kick off another - - qDebug() << "IP address lookup timed out for" << _iceServerAddr << "- retrying"; - - QHostInfo::abortHostLookup(_iceAddressLookupID); - - _iceAddressLookupID = INVALID_ICE_LOOKUP_ID; - - updateICEServerAddresses(); } } @@ -3007,9 +2987,20 @@ void DomainServer::handleKeypairChange() { void DomainServer::handleICEHostInfo(const QHostInfo& hostInfo) { // clear the ICE address lookup ID so that it can fire again - _iceAddressLookupID = -1; + _iceAddressLookupID = INVALID_ICE_LOOKUP_ID; - if (hostInfo.error() != QHostInfo::NoError) { + // enumerate the returned addresses and collect only valid IPv4 addresses + QList sanitizedAddresses = hostInfo.addresses(); + auto it = sanitizedAddresses.begin(); + while (it != sanitizedAddresses.end()) { + if (!it->isNull() && it->protocol() == QAbstractSocket::IPv4Protocol) { + ++it; + } else { + it = sanitizedAddresses.erase(it); + } + } + + if (hostInfo.error() != QHostInfo::NoError || sanitizedAddresses.empty()) { qWarning() << "IP address lookup failed for" << _iceServerAddr << ":" << hostInfo.errorString(); // if we don't have an ICE server to use yet, trigger a retry @@ -3022,7 +3013,7 @@ void DomainServer::handleICEHostInfo(const QHostInfo& hostInfo) { } else { int countBefore = _iceServerAddresses.count(); - _iceServerAddresses = hostInfo.addresses(); + _iceServerAddresses = sanitizedAddresses; if (countBefore == 0) { qInfo() << "Found" << _iceServerAddresses.count() << "ice-server IP addresses for" << _iceServerAddr; diff --git a/domain-server/src/DomainServer.h b/domain-server/src/DomainServer.h index 3fc87bbd59..b45b8a4816 100644 --- a/domain-server/src/DomainServer.h +++ b/domain-server/src/DomainServer.h @@ -116,8 +116,6 @@ private slots: void tokenGrantFinished(); void profileRequestFinished(); - void timeoutICEAddressLookup(); - signals: void iceServerChanged(); void userConnected(); diff --git a/libraries/networking/src/HifiSockAddr.h b/libraries/networking/src/HifiSockAddr.h index b582198139..3c753f0434 100644 --- a/libraries/networking/src/HifiSockAddr.h +++ b/libraries/networking/src/HifiSockAddr.h @@ -34,7 +34,7 @@ public: HifiSockAddr(const sockaddr* sockaddr); bool isNull() const { return _address.isNull() && _port == 0; } - void clear() { _address = QHostAddress::Null; _port = 0;} + void clear() { _address.clear(); _port = 0;} HifiSockAddr& operator=(const HifiSockAddr& rhsSockAddr); void swap(HifiSockAddr& otherSockAddr);