mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 20:58:38 +02:00
adding changes for overriding host change for error state
This commit is contained in:
parent
3fe3f674d0
commit
ad233677b8
3 changed files with 11 additions and 4 deletions
|
@ -269,6 +269,7 @@ bool AddressManager::handleUrl(const QUrl& lookupUrl, LookupTrigger trigger) {
|
||||||
// save the last visited domain URL.
|
// save the last visited domain URL.
|
||||||
_lastVisitedURL = lookupUrl;
|
_lastVisitedURL = lookupUrl;
|
||||||
|
|
||||||
|
auto lastVisitedURLStr = lookupUrl.toString().toStdString();
|
||||||
// a network address lookup clears the previous lookup since we don't expect to re-attempt it
|
// a network address lookup clears the previous lookup since we don't expect to re-attempt it
|
||||||
_previousAPILookup.clear();
|
_previousAPILookup.clear();
|
||||||
|
|
||||||
|
@ -816,8 +817,10 @@ bool AddressManager::setDomainInfo(const QUrl& domainURL, LookupTrigger trigger)
|
||||||
const QString hostname = domainURL.host();
|
const QString hostname = domainURL.host();
|
||||||
quint16 port = domainURL.port();
|
quint16 port = domainURL.port();
|
||||||
bool emitHostChanged { false };
|
bool emitHostChanged { false };
|
||||||
|
// Check if domain handler is in error state. always emit host changed if true.
|
||||||
|
bool isInErrorState = DependencyManager::get<NodeList>()->getDomainHandler().isInErrorState();
|
||||||
|
|
||||||
if (domainURL != _domainURL) {
|
if (domainURL != _domainURL || isInErrorState) {
|
||||||
addCurrentAddressToHistory(trigger);
|
addCurrentAddressToHistory(trigger);
|
||||||
emitHostChanged = true;
|
emitHostChanged = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -56,7 +56,7 @@ DomainHandler::DomainHandler(QObject* parent) :
|
||||||
// stop the refresh timer if we connect to a domain
|
// stop the refresh timer if we connect to a domain
|
||||||
connect(this, &DomainHandler::connectedToDomain, &_apiRefreshTimer, &QTimer::stop);
|
connect(this, &DomainHandler::connectedToDomain, &_apiRefreshTimer, &QTimer::stop);
|
||||||
|
|
||||||
// stop the refresh timer if we connect to a domain
|
// stop the refresh timer if redirected to the error domain
|
||||||
connect(this, &DomainHandler::redirectToErrorDomainURL, &_apiRefreshTimer, &QTimer::stop);
|
connect(this, &DomainHandler::redirectToErrorDomainURL, &_apiRefreshTimer, &QTimer::stop);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -109,14 +109,16 @@ void DomainHandler::softReset() {
|
||||||
QMetaObject::invokeMethod(&_settingsTimer, "stop");
|
QMetaObject::invokeMethod(&_settingsTimer, "stop");
|
||||||
|
|
||||||
// restart the API refresh timer in case we fail to connect and need to refresh information
|
// restart the API refresh timer in case we fail to connect and need to refresh information
|
||||||
if (!_isInErrorState)
|
if (!_isInErrorState) {
|
||||||
QMetaObject::invokeMethod(&_apiRefreshTimer, "start");
|
QMetaObject::invokeMethod(&_apiRefreshTimer, "start");
|
||||||
|
}
|
||||||
_isInErrorState = false;
|
_isInErrorState = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DomainHandler::hardReset() {
|
void DomainHandler::hardReset() {
|
||||||
if (!_isInErrorState)
|
if (!_isInErrorState) {
|
||||||
emit resetting();
|
emit resetting();
|
||||||
|
}
|
||||||
|
|
||||||
softReset();
|
softReset();
|
||||||
|
|
||||||
|
|
|
@ -173,6 +173,8 @@ public slots:
|
||||||
// sets domain handler in error state.
|
// sets domain handler in error state.
|
||||||
void setRedirectErrorState(QUrl errorUrl, int reasonCode);
|
void setRedirectErrorState(QUrl errorUrl, int reasonCode);
|
||||||
|
|
||||||
|
bool isInErrorState() { return _isInErrorState; }
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void completedHostnameLookup(const QHostInfo& hostInfo);
|
void completedHostnameLookup(const QHostInfo& hostInfo);
|
||||||
void completedIceServerHostnameLookup();
|
void completedIceServerHostnameLookup();
|
||||||
|
|
Loading…
Reference in a new issue