resolve conflicts on merge with origin/protocol

This commit is contained in:
Stephen Birarda 2015-08-27 14:47:35 -07:00
commit eae90cbe8a
25 changed files with 51 additions and 30 deletions

View file

@ -1,5 +1,6 @@
//
// AssetServer.cpp
// assignment-client/src/assets
//
// Created by Ryan Huffman on 2015/07/21
// Copyright 2015 High Fidelity, Inc.

View file

@ -1,5 +1,6 @@
//
// AssetServer.h
// assignment-client/src/assets
//
// Created by Ryan Huffman on 2015/07/21
// Copyright 2015 High Fidelity, Inc.

View file

@ -1,5 +1,6 @@
//
// SendAssetTask.cpp
// assignment-client/src/assets
//
// Created by Ryan Huffman on 2015/08/26
// Copyright 2015 High Fidelity, Inc.

View file

@ -1,5 +1,6 @@
//
// SendAssetTask.h
// assignment-client/src/assets
//
// Created by Ryan Huffman on 2015/08/26
// Copyright 2015 High Fidelity, Inc.

View file

@ -1,5 +1,6 @@
//
// AssetClient.cpp
// libraries/networking/src
//
// Created by Ryan Huffman on 2015/07/21
// Copyright 2015 High Fidelity, Inc.

View file

@ -1,5 +1,6 @@
//
// AssetClient.h
// libraries/networking/src
//
// Created by Ryan Huffman on 2015/07/21
// Copyright 2015 High Fidelity, Inc.

View file

@ -1,5 +1,6 @@
//
// AssetRequest.cpp
// libraries/networking/src
//
// Created by Ryan Huffman on 2015/07/24
// Copyright 2015 High Fidelity, Inc.

View file

@ -1,5 +1,6 @@
//
// AssetRequest.h
// libraries/networking/src
//
// Created by Ryan Huffman on 2015/07/24
// Copyright 2015 High Fidelity, Inc.

View file

@ -1,5 +1,6 @@
//
// AssetResourceRequest.cpp
// libraries/networking/src
//
// Created by Ryan Huffman on 2015/07/23
// Copyright 2015 High Fidelity, Inc.

View file

@ -1,5 +1,6 @@
//
// AssetResourceRequest.h
// libraries/networking/src
//
// Created by Ryan Huffman on 2015/07/23
// Copyright 2015 High Fidelity, Inc.

View file

@ -1,5 +1,6 @@
//
// AssetUtils.h
// libraries/networking/src
//
// Created by Ryan Huffman on 2015/07/30
// Copyright 2015 High Fidelity, Inc.

View file

@ -1,5 +1,6 @@
//
// FileResourceRequest.cpp
// libraries/networking/src
//
// Created by Ryan Huffman on 2015/07/23
// Copyright 2015 High Fidelity, Inc.

View file

@ -1,5 +1,6 @@
//
// FileResourceRequest.h
// libraries/networking/src
//
// Created by Ryan Huffman on 2015/07/23
// Copyright 2015 High Fidelity, Inc.

View file

@ -1,5 +1,6 @@
//
// HTTPResourceRequest.cpp
// libraries/networking/src
//
// Created by Ryan Huffman on 2015/07/23
// Copyright 2015 High Fidelity, Inc.

View file

@ -1,5 +1,6 @@
//
// HTTPResourceRequest.h
// libraries/networking/src
//
// Created by Ryan Huffman on 2015/07/23
// Copyright 2015 High Fidelity, Inc.

View file

@ -154,14 +154,18 @@ void ResourceCache::clearUnusedResource() {
void ResourceCache::attemptRequest(Resource* resource) {
auto sharedItems = DependencyManager::get<ResourceCacheSharedItems>();
// if (_requestLimit <= 0) {
// qDebug() << "REQUEST LIMIT REACHED (" << _requestLimit << "), queueing: " << resource->getURL();
// // wait until a slot becomes available
// sharedItems->_pendingRequests.append(resource);
// return;
// }
if (_requestLimit <= 0) {
qDebug() << "REQUEST LIMIT REACHED (" << _requestLimit << "), queueing: " << resource->getURL();
// wait until a slot becomes available
sharedItems->_pendingRequests.append(resource);
return;
}
qDebug() << "-- Decreasing limit for : " << resource->getURL();
_requestLimit--;
// Disable request limiting for ATP
if (resource->getURL() != URL_SCHEME_ATP) {
_requestLimit--;
}
sharedItems->_loadingRequests.append(resource);
resource->makeRequest();
}
@ -171,7 +175,9 @@ void ResourceCache::requestCompleted(Resource* resource) {
auto sharedItems = DependencyManager::get<ResourceCacheSharedItems>();
sharedItems->_loadingRequests.removeOne(resource);
qDebug() << "++ Increasing limit after finished: " << resource->getURL();
_requestLimit++;
if (resource->getURL() != URL_SCHEME_ATP) {
_requestLimit++;
}
// look for the highest priority pending request
int highestIndex = -1;
@ -206,7 +212,7 @@ Resource::Resource(const QUrl& url, bool delayLoad) :
// start loading immediately unless instructed otherwise
if (!(_startedLoading || delayLoad)) {
QTimer::singleShot(1, this, &Resource::attemptRequest);
QTimer::singleShot(0, this, &Resource::ensureLoading);
}
}
@ -333,8 +339,6 @@ void Resource::reinsert() {
void Resource::makeRequest() {
Q_ASSERT(!_request);
static const int REPLY_TIMEOUT_MS = 5000;
_request = ResourceManager::createResourceRequest(this, _activeUrl);
if (!_request) {
@ -360,13 +364,12 @@ void Resource::handleDownloadProgress(uint64_t bytesReceived, uint64_t bytesTota
}
void Resource::handleReplyFinished() {
QString u = _url.path();
Q_ASSERT(_request);
auto result = _request->getResult();
if (result == ResourceRequest::SUCCESS) {
_data = _request->getData();
qDebug() << "Reqeust finsihed for " << _url << ", " << _activeUrl;
qDebug() << "Request finished for " << _url << ", " << _activeUrl;
_request->disconnect(this);
_request->deleteLater();
@ -383,8 +386,7 @@ void Resource::handleReplyFinished() {
_request = nullptr;
if (result == ResourceRequest::Result::TIMEOUT) {
qDebug() << "Timed out loading" << _url <<
"received" << _bytesReceived << "total" << _bytesTotal;
qDebug() << "Timed out loading" << _url << "received" << _bytesReceived << "total" << _bytesTotal;
} else {
qDebug() << "Error loading " << _url;
}
@ -408,7 +410,8 @@ void Resource::handleReplyFinished() {
break;
}
emit failed(QNetworkReply::UnknownNetworkError);
auto error = result == ResourceRequest::TIMEOUT ? QNetworkReply::TimeoutError : QNetworkReply::UnknownNetworkError;
emit failed(error);
if (!retry) {
ResourceCache::requestCompleted(this);

View file

@ -1,5 +1,6 @@
//
// ResourceManager.cpp
// libraries/networking/src
//
// Created by Ryan Huffman on 2015/07/23
// Copyright 2015 High Fidelity, Inc.
@ -16,12 +17,6 @@
#include <SharedUtil.h>
const QString URL_SCHEME_FILE = "file";
const QString URL_SCHEME_HTTP = "http";
const QString URL_SCHEME_HTTPS = "https";
const QString URL_SCHEME_FTP = "ftp";
const QString URL_SCHEME_ATP = "atp";
ResourceRequest* ResourceManager::createResourceRequest(QObject* parent, const QUrl& url) {
auto scheme = url.scheme();
if (scheme == URL_SCHEME_FILE) {

View file

@ -1,5 +1,6 @@
//
// ResourceManager.h
// libraries/networking/src
//
// Created by Ryan Huffman on 2015/07/23
// Copyright 2015 High Fidelity, Inc.
@ -15,6 +16,12 @@
#include "ResourceRequest.h"
const QString URL_SCHEME_FILE = "file";
const QString URL_SCHEME_HTTP = "http";
const QString URL_SCHEME_HTTPS = "https";
const QString URL_SCHEME_FTP = "ftp";
const QString URL_SCHEME_ATP = "atp";
class ResourceManager {
public:
static ResourceRequest* createResourceRequest(QObject* parent, const QUrl& url);

View file

@ -1,5 +1,6 @@
//
// ResourceRequest.cpp
// libraries/networking/src
//
// Created by Ryan Huffman on 2015/07/23
// Copyright 2015 High Fidelity, Inc.

View file

@ -1,5 +1,6 @@
//
// ResourceRequest.h
// libraries/networking/src
//
// Created by Ryan Huffman on 2015/07/23
// Copyright 2015 High Fidelity, Inc.

View file

@ -625,8 +625,12 @@ void Connection::processNAK(std::unique_ptr<ControlPacket> controlPacket) {
}
void Connection::processHandshake(std::unique_ptr<ControlPacket> controlPacket) {
// server sent us a handshake - we need to assume this means state should be reset
resetReceiveState();
if (!_hasReceivedHandshake || _hasReceivedFirstPacket) {
// server sent us a handshake - we need to assume this means state should be reset
// as long as we haven't received a handshake yet or we have and we've received some data
resetReceiveState();
}
// immediately respond with a handshake ACK
static auto handshakeACK = ControlPacket::create(ControlPacket::HandshakeACK, 0);

View file

@ -143,7 +143,7 @@ qint64 PacketList::writeData(const char* data, qint64 maxSize) {
// this is an unsupported case - the segment is bigger than the size of an individual packet
// but the PacketList is not going to be sent ordered
qDebug() << "Error in PacketList::writeData - attempted to write a segment to an unordered packet that is"
<< "larger than the payload size.";
<< "larger than the payload size.";
Q_ASSERT(false);
}

View file

@ -1354,9 +1354,7 @@ void Model::inverseKinematics(int endIndex, glm::vec3 targetPosition, const glm:
}
bool Model::restoreJointPosition(int jointIndex, float fraction, float priority) {
QString url = _url.path();
const FBXGeometry& geometry = _geometry->getFBXGeometry();
return true;
const QVector<int>& freeLineage = geometry.joints.at(jointIndex).freeLineage;
return _rig->restoreJointPosition(jointIndex, fraction, priority, freeLineage);
}

View file

@ -294,7 +294,6 @@ public:
void ImageReader::run() {
QSharedPointer<Resource> texture = _texture.toStrongRef();
if (texture.isNull()) {
qDebug() << "TEXTURE IS NULL";
return;
}

View file

@ -27,8 +27,6 @@ ScriptCache::ScriptCache(QObject* parent) {
}
QString ScriptCache::getScript(const QUrl& url, ScriptUser* scriptUser, bool& isPending, bool reload) {
//assert(!_scriptCache.contains(url) || !reload);
QString scriptContents;
if (_scriptCache.contains(url) && !reload) {
qCDebug(scriptengine) << "Found script in cache:" << url.toString();