mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-04 03:24:46 +02:00
fix removal of requestHash method during cherry-pick
This commit is contained in:
parent
e6ce517041
commit
4bf69f20b7
2 changed files with 13 additions and 8 deletions
|
@ -46,16 +46,17 @@ void AssetResourceRequest::doSend() {
|
|||
// We've detected that this is a hash - simply use AssetClient to request that asset
|
||||
auto parts = _url.path().split(".", QString::SkipEmptyParts);
|
||||
auto hash = parts.length() > 0 ? parts[0] : "";
|
||||
auto extension = parts.length() > 1 ? parts[1] : "";
|
||||
|
||||
// in case we haven't parsed a valid hash, return an error now
|
||||
if (hash.length() != SHA256_HASH_HEX_LENGTH) {
|
||||
_result = InvalidURL;
|
||||
_state = Finished;
|
||||
requestHash(hash);
|
||||
}
|
||||
}
|
||||
|
||||
emit finished();
|
||||
return;
|
||||
}
|
||||
void AssetResourceRequest::requestHash(const QString& hash) {
|
||||
|
||||
// in case we haven't parsed a valid hash, return an error now
|
||||
if (hash.length() != SHA256_HASH_HEX_LENGTH) {
|
||||
_result = InvalidURL;
|
||||
_state = Finished;
|
||||
|
||||
emit finished();
|
||||
return;
|
||||
|
|
|
@ -30,6 +30,10 @@ private slots:
|
|||
void onDownloadProgress(qint64 bytesReceived, qint64 bytesTotal);
|
||||
|
||||
private:
|
||||
bool urlIsAssetPath() const;
|
||||
|
||||
void requestHash(const QString& hash);
|
||||
|
||||
AssetRequest* _assetRequest { nullptr };
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue