Merge pull request #12820 from birarda/bug/store-serverless-with-tilde

RC66 - move file ~ expansion from AddressManager to DomainHandler
This commit is contained in:
John Conklin II 2018-04-06 13:31:01 -07:00 committed by GitHub
commit 02422ba538
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 5 deletions

View file

@ -22,7 +22,6 @@
#include <NumericalConstants.h>
#include <SettingHandle.h>
#include <UUID.h>
#include <PathUtils.h>
#include "AddressManager.h"
#include "NodeList.h"
@ -311,8 +310,7 @@ bool AddressManager::handleUrl(const QUrl& lookupUrl, LookupTrigger trigger) {
// lookupUrl.scheme() == URL_SCHEME_HTTPS ||
_previousLookup.clear();
_shareablePlaceName.clear();
QUrl domainURL = PathUtils::expandToLocalDataAbsolutePath(lookupUrl);
setDomainInfo(domainURL, trigger);
setDomainInfo(lookupUrl, trigger);
emit lookupResultsFinished();
handlePath(DOMAIN_SPAWNING_POINT, LookupTrigger::Internal, false);
return true;

View file

@ -9,8 +9,12 @@
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
//
#include "DomainHandler.h"
#include <math.h>
#include <PathUtils.h>
#include <QtCore/QJsonDocument>
#include <QtCore/QDataStream>
@ -25,8 +29,6 @@
#include "UserActivityLogger.h"
#include "NetworkLogging.h"
#include "DomainHandler.h"
DomainHandler::DomainHandler(QObject* parent) :
QObject(parent),
_sockAddr(HifiSockAddr(QHostAddress::Null, DEFAULT_DOMAIN_SERVER_PORT)),
@ -157,6 +159,11 @@ void DomainHandler::setURLAndID(QUrl domainURL, QUuid domainID) {
if (domainURL.scheme() != URL_SCHEME_HIFI) {
_sockAddr.clear();
// if this is a file URL we need to see if it has a ~ for us to expand
if (domainURL.scheme() == URL_SCHEME_FILE) {
domainURL = PathUtils::expandToLocalDataAbsolutePath(domainURL);
}
}
if (_domainURL != domainURL || _sockAddr.getPort() != domainURL.port()) {