summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerassetupload.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llviewerassetupload.cpp')
-rw-r--r--indra/newview/llviewerassetupload.cpp23
1 files changed, 13 insertions, 10 deletions
diff --git a/indra/newview/llviewerassetupload.cpp b/indra/newview/llviewerassetupload.cpp
index 1923e7d6ff..bc07821ccd 100644
--- a/indra/newview/llviewerassetupload.cpp
+++ b/indra/newview/llviewerassetupload.cpp
@@ -45,7 +45,7 @@
#include "llviewerassetupload.h"
#include "llappviewer.h"
#include "llviewerstats.h"
-#include "llfilesystem.h"
+#include "llvfile.h"
#include "llgesturemgr.h"
#include "llpreviewnotecard.h"
#include "llpreviewgesture.h"
@@ -467,13 +467,15 @@ LLSD LLNewFileResourceUploadInfo::exportTempFile()
setAssetType(assetType);
- // copy this file into the cache for upload
+ // copy this file into the vfs for upload
S32 file_size;
LLAPRFile infile;
infile.open(filename, LL_APR_RB, NULL, &file_size);
if (infile.getFileHandle())
{
- LLFileSystem file(getAssetId(), assetType, LLFileSystem::WRITE);
+ LLVFile file(gVFS, getAssetId(), assetType, LLVFile::WRITE);
+
+ file.setMaxSize(file_size);
const S32 buf_size = 65536;
U8 copy_buf[buf_size];
@@ -505,7 +507,7 @@ LLBufferedAssetUploadInfo::LLBufferedAssetUploadInfo(LLUUID itemId, LLAssetType:
mContents(buffer),
mInvnFinishFn(finish),
mTaskFinishFn(nullptr),
- mStoredToCache(false)
+ mStoredToVFS(false)
{
setItemId(itemId);
setAssetType(assetType);
@@ -519,7 +521,7 @@ LLBufferedAssetUploadInfo::LLBufferedAssetUploadInfo(LLUUID itemId, LLPointer<LL
mContents(),
mInvnFinishFn(finish),
mTaskFinishFn(nullptr),
- mStoredToCache(false)
+ mStoredToVFS(false)
{
setItemId(itemId);
@@ -553,7 +555,7 @@ LLBufferedAssetUploadInfo::LLBufferedAssetUploadInfo(LLUUID taskId, LLUUID itemI
mContents(buffer),
mInvnFinishFn(nullptr),
mTaskFinishFn(finish),
- mStoredToCache(false)
+ mStoredToVFS(false)
{
setItemId(itemId);
setAssetType(assetType);
@@ -564,12 +566,13 @@ LLSD LLBufferedAssetUploadInfo::prepareUpload()
if (getAssetId().isNull())
generateNewAssetId();
- LLFileSystem file(getAssetId(), getAssetType(), LLFileSystem::APPEND);
+ LLVFile file(gVFS, getAssetId(), getAssetType(), LLVFile::APPEND);
S32 size = mContents.length() + 1;
+ file.setMaxSize(size);
file.write((U8*)mContents.c_str(), size);
- mStoredToCache = true;
+ mStoredToVFS = true;
return LLSD().with("success", LLSD::Boolean(true));
}
@@ -592,10 +595,10 @@ LLUUID LLBufferedAssetUploadInfo::finishUpload(LLSD &result)
LLUUID newAssetId = result["new_asset"].asUUID();
LLUUID itemId = getItemId();
- if (mStoredToCache)
+ if (mStoredToVFS)
{
LLAssetType::EType assetType(getAssetType());
- LLFileSystem::renameFile(getAssetId(), assetType, newAssetId, assetType);
+ gVFS->renameFile(getAssetId(), assetType, newAssetId, assetType);
}
if (mTaskUpload)