summaryrefslogtreecommitdiff
path: root/indra/newview/llpreviewscript.cpp
diff options
context:
space:
mode:
authorakleshchev <117672381+akleshchev@users.noreply.github.com>2022-12-07 02:16:12 +0200
committerGitHub <noreply@github.com>2022-12-07 02:16:12 +0200
commitc69c8aa347363bc51ed256523bc368d4584dbfd1 (patch)
tree8e60dd7e471a00634452189f85d67b3901e52136 /indra/newview/llpreviewscript.cpp
parentc033278ec2d16181b94d6433a3353765c8981850 (diff)
SL-18777 PBR upload was stuck waiting for texture
Handle obscure upload failure case - floater was waiting for a texture upload indefinetely. Unblock floater if upload fails.
Diffstat (limited to 'indra/newview/llpreviewscript.cpp')
-rw-r--r--indra/newview/llpreviewscript.cpp32
1 files changed, 30 insertions, 2 deletions
diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp
index 5043250e08..8b93dd103d 100644
--- a/indra/newview/llpreviewscript.cpp
+++ b/indra/newview/llpreviewscript.cpp
@@ -1686,6 +1686,32 @@ void LLPreviewLSL::finishedLSLUpload(LLUUID itemId, LLSD response)
}
}
+bool LLPreviewLSL::failedLSLUpload(LLUUID itemId, LLUUID taskId, LLSD response, std::string reason)
+{
+ LLSD floater_key;
+ if (taskId.notNull())
+ {
+ floater_key["taskid"] = taskId;
+ floater_key["itemid"] = itemId;
+ }
+ else
+ {
+ floater_key = LLSD(itemId);
+ }
+
+ LLPreviewLSL* preview = LLFloaterReg::findTypedInstance<LLPreviewLSL>("preview_script", floater_key);
+ if (preview)
+ {
+ // unfreeze floater
+ LLSD errors;
+ errors.append(LLTrans::getString("UploadFailed") + reason);
+ preview->callbackLSLCompileFailed(errors);
+ return true;
+ }
+
+ return false;
+}
+
// Save needs to compile the text in the buffer. If the compile
// succeeds, then save both assets out to the database. If the compile
// fails, go ahead and save the text anyway.
@@ -1723,7 +1749,8 @@ void LLPreviewLSL::saveIfNeeded(bool sync /*= true*/)
[old_asset_id](LLUUID itemId, LLUUID, LLUUID, LLSD response) {
LLFileSystem::removeFile(old_asset_id, LLAssetType::AT_LSL_TEXT);
LLPreviewLSL::finishedLSLUpload(itemId, response);
- }));
+ },
+ LLPreviewLSL::failedLSLUpload));
LLViewerAssetUpload::EnqueueInventoryUpload(url, uploadInfo);
}
@@ -2282,7 +2309,8 @@ void LLLiveLSLEditor::saveIfNeeded(bool sync /*= true*/)
[isRunning, old_asset_id](LLUUID itemId, LLUUID taskId, LLUUID newAssetId, LLSD response) {
LLFileSystem::removeFile(old_asset_id, LLAssetType::AT_LSL_TEXT);
LLLiveLSLEditor::finishLSLUpload(itemId, taskId, newAssetId, response, isRunning);
- }));
+ },
+ nullptr)); // needs failure handling?
LLViewerAssetUpload::EnqueueInventoryUpload(url, uploadInfo);
}