diff --git a/libraries/networking/src/AssetRequest.cpp b/libraries/networking/src/AssetRequest.cpp index d3863a5882..9e77899961 100644 --- a/libraries/networking/src/AssetRequest.cpp +++ b/libraries/networking/src/AssetRequest.cpp @@ -27,7 +27,6 @@ AssetRequest::AssetRequest(QObject* parent, QString hash) : void AssetRequest::start() { if (QThread::currentThread() != thread()) { QMetaObject::invokeMethod(this, "start", Qt::AutoConnection); - //(&AssetRequest::start) return; } @@ -38,7 +37,7 @@ void AssetRequest::start() { assetClient->getAssetInfo(_hash, [this](bool success, AssetInfo info) { _info = info; _data.resize(info.size); - const DataOffset CHUNK_SIZE = 1024; + const DataOffset CHUNK_SIZE = 1024000000; qDebug() << "Got size of " << _hash << " : " << info.size << " bytes"; @@ -72,7 +71,3 @@ void AssetRequest::start() { }); } } - -const QByteArray& AssetRequest::getData() { - return _data; -} diff --git a/libraries/networking/src/AssetRequest.h b/libraries/networking/src/AssetRequest.h index 402aacad09..1e3e3e2f27 100644 --- a/libraries/networking/src/AssetRequest.h +++ b/libraries/networking/src/AssetRequest.h @@ -19,18 +19,6 @@ #include "AssetUtils.h" -// You should be able to get an asset from any thread, and handle the responses in a safe way -// on your own thread. Everything should happen on AssetClient's thread, the caller should -// receive events by connecting to signals on an object that lives on AssetClient's threads. - -// Receives parts of an asset and puts them together -// Emits signals: -// Progress -// Completion, success or error -// On finished, the AssetClient is effectively immutable and can be read from -// any thread safely -// -// Will often make multiple requests to the AssetClient to get data class AssetRequest : public QObject { Q_OBJECT public: @@ -51,16 +39,8 @@ public: AssetRequest(QObject* parent, QString hash); Q_INVOKABLE void start(); - //AssetRequest* requestAsset(QString hash); - // Create AssetRequest - // Start request for hash - // Store messageID -> AssetRequest - // When complete: - // Update AssetRequest - // AssetRequest emits signal - void receiveData(DataOffset start, DataOffset end, QByteArray data); - const QByteArray& getData(); + const QByteArray& getData() { return _data; } signals: void finished(AssetRequest*); @@ -74,7 +54,6 @@ private: QString _hash; QByteArray _data; int _numPendingRequests { 0 }; - // Timeout }; #endif