mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 09:28:46 +02:00
check for hard refusal to 404
This commit is contained in:
parent
eab57633a5
commit
5f05be554f
2 changed files with 8 additions and 1 deletions
|
@ -139,6 +139,11 @@ void DomainHandler::hardReset() {
|
||||||
_pendingPath.clear();
|
_pendingPath.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool DomainHandler::isHardRefusal(int reasonCode) {
|
||||||
|
return (reasonCode == (int)ConnectionRefusedReason::ProtocolMismatch || reasonCode == (int)ConnectionRefusedReason::NotAuthorized ||
|
||||||
|
reasonCode == (int)ConnectionRefusedReason::TimedOut);
|
||||||
|
}
|
||||||
|
|
||||||
bool DomainHandler::getInterstitialModeEnabled() const {
|
bool DomainHandler::getInterstitialModeEnabled() const {
|
||||||
return _interstitialModeSettingLock.resultWithReadLock<bool>([&] {
|
return _interstitialModeSettingLock.resultWithReadLock<bool>([&] {
|
||||||
return _enableInterstitialMode.get();
|
return _enableInterstitialMode.get();
|
||||||
|
@ -360,7 +365,7 @@ void DomainHandler::loadedErrorDomain(std::map<QString, QString> namedPaths) {
|
||||||
|
|
||||||
void DomainHandler::setRedirectErrorState(QUrl errorUrl, QString reasonMessage, int reasonCode, const QString& extraInfo) {
|
void DomainHandler::setRedirectErrorState(QUrl errorUrl, QString reasonMessage, int reasonCode, const QString& extraInfo) {
|
||||||
_lastDomainConnectionError = reasonCode;
|
_lastDomainConnectionError = reasonCode;
|
||||||
if (getInterstitialModeEnabled()) {
|
if (getInterstitialModeEnabled() && isHardRefusal(reasonCode)) {
|
||||||
_errorDomainURL = errorUrl;
|
_errorDomainURL = errorUrl;
|
||||||
_isInErrorState = true;
|
_isInErrorState = true;
|
||||||
qCDebug(networking) << "Error connecting to domain: " << reasonMessage;
|
qCDebug(networking) << "Error connecting to domain: " << reasonMessage;
|
||||||
|
|
|
@ -212,6 +212,8 @@ private:
|
||||||
void sendDisconnectPacket();
|
void sendDisconnectPacket();
|
||||||
void hardReset();
|
void hardReset();
|
||||||
|
|
||||||
|
bool isHardRefusal(int reasonCode);
|
||||||
|
|
||||||
QUuid _uuid;
|
QUuid _uuid;
|
||||||
Node::LocalID _localID;
|
Node::LocalID _localID;
|
||||||
QUrl _domainURL;
|
QUrl _domainURL;
|
||||||
|
|
Loading…
Reference in a new issue