summaryrefslogtreecommitdiff
path: root/indra/newview/llassetuploadqueue.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llassetuploadqueue.cpp')
-rwxr-xr-xindra/newview/llassetuploadqueue.cpp89
1 files changed, 46 insertions, 43 deletions
diff --git a/indra/newview/llassetuploadqueue.cpp b/indra/newview/llassetuploadqueue.cpp
index 4bdb690225..8833c57948 100755
--- a/indra/newview/llassetuploadqueue.cpp
+++ b/indra/newview/llassetuploadqueue.cpp
@@ -36,6 +36,7 @@
class LLAssetUploadChainResponder : public LLUpdateTaskInventoryResponder
{
+ LOG_CLASS(LLAssetUploadChainResponder);
public:
LLAssetUploadChainResponder(const LLSD& post_data,
@@ -51,58 +52,60 @@ public:
mDataSize(data_size),
mScriptName(script_name)
{
- }
+ }
virtual ~LLAssetUploadChainResponder()
- {
- if(mSupplier)
- {
- LLAssetUploadQueue *queue = mSupplier->get();
- if (queue)
- {
- // Give ownership of supplier back to queue.
- queue->mSupplier = mSupplier;
- mSupplier = NULL;
- }
- }
- delete mSupplier;
+ {
+ if(mSupplier)
+ {
+ LLAssetUploadQueue *queue = mSupplier->get();
+ if (queue)
+ {
+ // Give ownership of supplier back to queue.
+ queue->mSupplier = mSupplier;
+ mSupplier = NULL;
+ }
+ }
+ delete mSupplier;
delete mData;
- }
+ }
- virtual void errorWithContent(U32 statusNum, const std::string& reason, const LLSD& content)
- {
- llwarns << "LLAssetUploadChainResponder Error [status:"
- << statusNum << "]: " << content << llendl;
- LLUpdateTaskInventoryResponder::errorWithContent(statusNum, reason, content);
- LLAssetUploadQueue *queue = mSupplier->get();
- if (queue)
+protected:
+ virtual void httpFailure()
+ {
+ // Parent class will spam the failure.
+ //LL_WARNS() << dumpResponse() << LL_ENDL;
+ LLUpdateTaskInventoryResponder::httpFailure();
+ LLAssetUploadQueue *queue = mSupplier->get();
+ if (queue)
+ {
+ queue->request(&mSupplier);
+ }
+ }
+
+ virtual void httpSuccess()
+ {
+ LLUpdateTaskInventoryResponder::httpSuccess();
+ LLAssetUploadQueue *queue = mSupplier->get();
+ if (queue)
{
- queue->request(&mSupplier);
- }
- }
-
- virtual void result(const LLSD& content)
- {
- LLUpdateTaskInventoryResponder::result(content);
- LLAssetUploadQueue *queue = mSupplier->get();
- if (queue)
- {
- // Responder is reused across 2 phase upload,
- // so only start next upload after 2nd phase complete.
- std::string state = content["state"];
- if(state == "complete")
- {
- queue->request(&mSupplier);
- }
- }
- }
+ // Responder is reused across 2 phase upload,
+ // so only start next upload after 2nd phase complete.
+ const std::string& state = getContent()["state"].asStringRef();
+ if(state == "complete")
+ {
+ queue->request(&mSupplier);
+ }
+ }
+ }
+public:
virtual void uploadUpload(const LLSD& content)
{
std::string uploader = content["uploader"];
mSupplier->log(std::string("Compiling " + mScriptName).c_str());
- llinfos << "Compiling " << llendl;
+ LL_INFOS() << "Compiling " << LL_ENDL;
// postRaw takes ownership of mData and will delete it.
LLHTTPClient::postRaw(uploader, mData, mDataSize, this);
@@ -116,7 +119,7 @@ public:
if (content["compiled"])
{
mSupplier->log("Compilation succeeded");
- llinfos << "Compiled!" << llendl;
+ LL_INFOS() << "Compiled!" << LL_ENDL;
}
else
{
@@ -127,7 +130,7 @@ public:
std::string str = line->asString();
str.erase(std::remove(str.begin(), str.end(), '\n'), str.end());
mSupplier->log(str);
- llinfos << content["errors"] << llendl;
+ LL_INFOS() << content["errors"] << LL_ENDL;
}
}
LLUpdateTaskInventoryResponder::uploadComplete(content);