summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorCallum Prentice <callum@gmail.com>2020-10-06 17:16:53 -0700
committerCallum Prentice <callum@gmail.com>2020-10-06 17:16:53 -0700
commit3092aa8aae496803707980eb456cddbb9960ef1c (patch)
tree4edf4ba655c005bdd89c7bd18641ed15d0840b6c /indra/newview
parent354930014bc90a9c92b33300e5ecaf7fa861fe7b (diff)
Add in the C++ filesystem based cache and clean up some indempotent functions in llfilesystem
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/app_settings/settings.xml11
-rw-r--r--indra/newview/llfloaterbvhpreview.cpp1
-rw-r--r--indra/newview/llmeshrepository.cpp2
-rw-r--r--indra/newview/llpreviewgesture.cpp1
-rw-r--r--indra/newview/llpreviewnotecard.cpp1
-rw-r--r--indra/newview/llviewerassetstorage.cpp3
-rw-r--r--indra/newview/llviewerassetupload.cpp3
7 files changed, 12 insertions, 10 deletions
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index c45d6dd7af..0123bc32af 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -1351,6 +1351,17 @@
<key>Value</key>
<integer>23</integer>
</map>
+ <key>CacheDebugInfo</key>
+ <map>
+ <key>Comment</key>
+ <string>When enabled, display additional cache debugging information</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Boolean</string>
+ <key>Value</key>
+ <integer>0</integer>
+ </map>
<key>CacheLocation</key>
<map>
<key>Comment</key>
diff --git a/indra/newview/llfloaterbvhpreview.cpp b/indra/newview/llfloaterbvhpreview.cpp
index 08f3b577b4..687d820a18 100644
--- a/indra/newview/llfloaterbvhpreview.cpp
+++ b/indra/newview/llfloaterbvhpreview.cpp
@@ -1000,7 +1000,6 @@ void LLFloaterBvhPreview::onBtnOK(void* userdata)
LLFileSystem file(motionp->getID(), LLAssetType::AT_ANIMATION, LLFileSystem::APPEND);
S32 size = dp.getCurrentSize();
- file.setMaxSize(size);
if (file.write((U8*)buffer, size))
{
std::string name = floaterp->getChild<LLUICtrl>("name_form")->getValue().asString();
diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp
index a0d591dc47..3183e6d8fd 100644
--- a/indra/newview/llmeshrepository.cpp
+++ b/indra/newview/llmeshrepository.cpp
@@ -3241,7 +3241,7 @@ void LLMeshHeaderHandler::processData(LLCore::BufferArray * /* body */, S32 /* b
data_size = llmin(data_size, bytes);
LLFileSystem file(mesh_id, LLAssetType::AT_MESH, LLFileSystem::WRITE);
- if (file.getMaxSize() >= bytes || file.setMaxSize(bytes))
+ if (file.getMaxSize() >= bytes)
{
LLMeshRepository::sCacheBytesWritten += data_size;
++LLMeshRepository::sCacheWrites;
diff --git a/indra/newview/llpreviewgesture.cpp b/indra/newview/llpreviewgesture.cpp
index 371153aac3..4318a55704 100644
--- a/indra/newview/llpreviewgesture.cpp
+++ b/indra/newview/llpreviewgesture.cpp
@@ -1140,7 +1140,6 @@ void LLPreviewGesture::saveIfNeeded()
LLFileSystem file(assetId, LLAssetType::AT_GESTURE, LLFileSystem::APPEND);
S32 size = dp.getCurrentSize();
- file.setMaxSize(size);
file.write((U8*)buffer, size);
LLLineEditor* descEditor = getChild<LLLineEditor>("desc");
diff --git a/indra/newview/llpreviewnotecard.cpp b/indra/newview/llpreviewnotecard.cpp
index 0bccf1d06f..32e1a4a186 100644
--- a/indra/newview/llpreviewnotecard.cpp
+++ b/indra/newview/llpreviewnotecard.cpp
@@ -563,7 +563,6 @@ bool LLPreviewNotecard::saveIfNeeded(LLInventoryItem* copyitem, bool sync)
tid, copyitem);
S32 size = buffer.length() + 1;
- file.setMaxSize(size);
file.write((U8*)buffer.c_str(), size);
gAssetStorage->storeAssetData(tid, LLAssetType::AT_NOTECARD,
diff --git a/indra/newview/llviewerassetstorage.cpp b/indra/newview/llviewerassetstorage.cpp
index df3ff1a3c7..5b76d57196 100644
--- a/indra/newview/llviewerassetstorage.cpp
+++ b/indra/newview/llviewerassetstorage.cpp
@@ -293,8 +293,6 @@ void LLViewerAssetStorage::storeAssetData(
LLFileSystem file(asset_id, asset_type, LLFileSystem::WRITE);
- file.setMaxSize(size);
-
const S32 buf_size = 65536;
U8 copy_buf[buf_size];
while ((size = (S32)fread(copy_buf, 1, buf_size, fp)))
@@ -528,7 +526,6 @@ void LLViewerAssetStorage::assetRequestCoro(
LLUUID temp_id;
temp_id.generate();
LLFileSystem vf(temp_id, atype, LLFileSystem::WRITE);
- vf.setMaxSize(size);
req->mBytesFetched = size;
if (!vf.write(raw.data(),size))
{
diff --git a/indra/newview/llviewerassetupload.cpp b/indra/newview/llviewerassetupload.cpp
index fb3ca69d5d..67ee06e255 100644
--- a/indra/newview/llviewerassetupload.cpp
+++ b/indra/newview/llviewerassetupload.cpp
@@ -474,8 +474,6 @@ LLSD LLNewFileResourceUploadInfo::exportTempFile()
{
LLFileSystem file(getAssetId(), assetType, LLFileSystem::WRITE);
- file.setMaxSize(file_size);
-
const S32 buf_size = 65536;
U8 copy_buf[buf_size];
while ((file_size = infile.read(copy_buf, buf_size)))
@@ -568,7 +566,6 @@ LLSD LLBufferedAssetUploadInfo::prepareUpload()
LLFileSystem file(getAssetId(), getAssetType(), LLFileSystem::APPEND);
S32 size = mContents.length() + 1;
- file.setMaxSize(size);
file.write((U8*)mContents.c_str(), size);
mStoredToCache = true;