diff options
author | Rider Linden <rider@lindenlab.com> | 2015-07-13 12:42:23 -0700 |
---|---|---|
committer | Rider Linden <rider@lindenlab.com> | 2015-07-13 12:42:23 -0700 |
commit | 0ba39810a90c5feaa741e5b1283c55e126bcaf66 (patch) | |
tree | 53ce2c066383d87ebbe7751f5498a7473ab5f2b4 /indra | |
parent | ec466b2f5ea5149a4d5d5ead12891d308a96b8ff (diff) |
Rename the file in VFS with the new asset AID (prevents crash on gesture change and fixes notecard update)
Diffstat (limited to 'indra')
-rwxr-xr-x | indra/newview/llpreviewgesture.cpp | 4 | ||||
-rw-r--r-- | indra/newview/llviewerassetupload.cpp | 19 | ||||
-rw-r--r-- | indra/newview/llviewerassetupload.h | 1 |
3 files changed, 18 insertions, 6 deletions
diff --git a/indra/newview/llpreviewgesture.cpp b/indra/newview/llpreviewgesture.cpp index 6c12885864..fc6023beb2 100755 --- a/indra/newview/llpreviewgesture.cpp +++ b/indra/newview/llpreviewgesture.cpp @@ -1051,7 +1051,7 @@ void LLPreviewGesture::saveIfNeeded() return; } -#if 0 +#if 1 // Copy the UI into a gesture LLMultiGesture* gesture = createGesture(); @@ -1123,7 +1123,7 @@ void LLPreviewGesture::saveIfNeeded() { delayedUpload = true; - LLCoprocedureManager::CoProcedure_t proc = boost::bind(&LLViewerAssetUpload::AssetInventoryUploadCoproc, _1, _2, _3, url, uploadInfo); + LLCoprocedureManager::CoProcedure_t proc = boost::bind(&LLViewerAssetUpload::AssetInventoryUploadCoproc, _1, _2, url, uploadInfo); LLCoprocedureManager::getInstance()->enqueueCoprocedure("LLViewerAssetUpload::AssetInventoryUploadCoproc", proc); } diff --git a/indra/newview/llviewerassetupload.cpp b/indra/newview/llviewerassetupload.cpp index f1a253a421..910e1dc6c5 100644 --- a/indra/newview/llviewerassetupload.cpp +++ b/indra/newview/llviewerassetupload.cpp @@ -449,7 +449,8 @@ LLBufferedAssetUploadInfo::LLBufferedAssetUploadInfo(LLUUID itemId, LLAssetType: mTaskId(LLUUID::null), mContents(buffer), mInvnFinishFn(finish), - mTaskFinishFn(NULL) + mTaskFinishFn(NULL), + mStoredToVFS(false) { setItemId(itemId); setAssetType(assetType); @@ -463,7 +464,8 @@ LLBufferedAssetUploadInfo::LLBufferedAssetUploadInfo(LLUUID taskId, LLUUID itemI mTaskId(taskId), mContents(buffer), mInvnFinishFn(NULL), - mTaskFinishFn(finish) + mTaskFinishFn(finish), + mStoredToVFS(false) { setItemId(itemId); setAssetType(assetType); @@ -481,6 +483,9 @@ LLSD LLBufferedAssetUploadInfo::prepareUpload() file.setMaxSize(size); file.write((U8*)mContents.c_str(), size); + mStoredToVFS = true; + + return LLSD().with("success", LLSD::Boolean(true)); } @@ -502,6 +507,12 @@ LLUUID LLBufferedAssetUploadInfo::finishUpload(LLSD &result) LLUUID newAssetId = result["new_asset"].asUUID(); LLUUID itemId = getItemId(); + if (mStoredToVFS) + { + LLAssetType::EType assetType(getAssetType()); + gVFS->renameFile(getAssetId(), assetType, newAssetId, assetType); + } + if (mTaskUpload) { LLUUID taskId = getTaskId(); @@ -542,8 +553,8 @@ LLUUID LLBufferedAssetUploadInfo::finishUpload(LLSD &result) //========================================================================= /*static*/ -void LLViewerAssetUpload::AssetInventoryUploadCoproc(LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t &httpAdapter, const LLUUID &id, - std::string url, NewResourceUploadInfo::ptr_t uploadInfo) +void LLViewerAssetUpload::AssetInventoryUploadCoproc(LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t &httpAdapter, + const LLUUID &id, std::string url, NewResourceUploadInfo::ptr_t uploadInfo) { LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); diff --git a/indra/newview/llviewerassetupload.h b/indra/newview/llviewerassetupload.h index 351c2267b7..b80166a874 100644 --- a/indra/newview/llviewerassetupload.h +++ b/indra/newview/llviewerassetupload.h @@ -177,6 +177,7 @@ private: std::string mContents; invnUploadFinish_f mInvnFinishFn; taskUploadFinish_f mTaskFinishFn; + bool mStoredToVFS; }; class LLScriptAssetUpload : public LLBufferedAssetUploadInfo |