mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 08:56:25 +02:00
Merge pull request #3234 from birarda/domain-server-auth
clear domain settings on NodeList reset
This commit is contained in:
commit
9c1362d7f4
3 changed files with 11 additions and 5 deletions
|
@ -49,9 +49,13 @@ void DomainHandler::clearSettings() {
|
||||||
_failedSettingsRequests = 0;
|
_failedSettingsRequests = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DomainHandler::reset() {
|
void DomainHandler::softReset() {
|
||||||
clearConnectionInfo();
|
clearConnectionInfo();
|
||||||
clearSettings();
|
clearSettings();
|
||||||
|
}
|
||||||
|
|
||||||
|
void DomainHandler::hardReset() {
|
||||||
|
softReset();
|
||||||
_hostname = QString();
|
_hostname = QString();
|
||||||
_sockAddr.setAddress(QHostAddress::Null);
|
_sockAddr.setAddress(QHostAddress::Null);
|
||||||
}
|
}
|
||||||
|
@ -59,7 +63,7 @@ void DomainHandler::reset() {
|
||||||
void DomainHandler::setSockAddr(const HifiSockAddr& sockAddr, const QString& hostname) {
|
void DomainHandler::setSockAddr(const HifiSockAddr& sockAddr, const QString& hostname) {
|
||||||
if (_sockAddr != sockAddr) {
|
if (_sockAddr != sockAddr) {
|
||||||
// we should reset on a sockAddr change
|
// we should reset on a sockAddr change
|
||||||
reset();
|
hardReset();
|
||||||
// change the sockAddr
|
// change the sockAddr
|
||||||
_sockAddr = sockAddr;
|
_sockAddr = sockAddr;
|
||||||
}
|
}
|
||||||
|
@ -72,7 +76,7 @@ void DomainHandler::setHostname(const QString& hostname) {
|
||||||
|
|
||||||
if (hostname != _hostname) {
|
if (hostname != _hostname) {
|
||||||
// re-set the domain info so that auth information is reloaded
|
// re-set the domain info so that auth information is reloaded
|
||||||
reset();
|
hardReset();
|
||||||
|
|
||||||
int colonIndex = hostname.indexOf(':');
|
int colonIndex = hostname.indexOf(':');
|
||||||
|
|
||||||
|
|
|
@ -62,6 +62,8 @@ public:
|
||||||
|
|
||||||
void parseDTLSRequirementPacket(const QByteArray& dtlsRequirementPacket);
|
void parseDTLSRequirementPacket(const QByteArray& dtlsRequirementPacket);
|
||||||
|
|
||||||
|
void softReset();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void completedHostnameLookup(const QHostInfo& hostInfo);
|
void completedHostnameLookup(const QHostInfo& hostInfo);
|
||||||
void settingsRequestFinished();
|
void settingsRequestFinished();
|
||||||
|
@ -73,7 +75,7 @@ signals:
|
||||||
void settingsReceiveFail();
|
void settingsReceiveFail();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void reset();
|
void hardReset();
|
||||||
|
|
||||||
QUuid _uuid;
|
QUuid _uuid;
|
||||||
QString _hostname;
|
QString _hostname;
|
||||||
|
|
|
@ -178,7 +178,7 @@ void NodeList::reset() {
|
||||||
setSessionUUID(QUuid());
|
setSessionUUID(QUuid());
|
||||||
|
|
||||||
// clear the domain connection information
|
// clear the domain connection information
|
||||||
_domainHandler.clearConnectionInfo();
|
_domainHandler.softReset();
|
||||||
|
|
||||||
// if we setup the DTLS socket, also disconnect from the DTLS socket readyRead() so it can handle handshaking
|
// if we setup the DTLS socket, also disconnect from the DTLS socket readyRead() so it can handle handshaking
|
||||||
if (_dtlsSocket) {
|
if (_dtlsSocket) {
|
||||||
|
|
Loading…
Reference in a new issue