From 50caebbad7f2e8f743b6a08831df2e525e8e6baa Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 2 May 2011 10:39:18 -0400 Subject: Added handler for final mesh object upload --- indra/newview/llmeshrepository.cpp | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) mode change 100644 => 100755 indra/newview/llmeshrepository.cpp (limited to 'indra/newview/llmeshrepository.cpp') diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp old mode 100644 new mode 100755 index e20e918a2a..dd2ffdf7f1 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -454,6 +454,29 @@ public: }; +class LLModelObjectUploadResponder: public LLCurl::Responder +{ + LLSD mObjectAsset; + LLMeshUploadThread* mThread; + +public: + LLModelObjectUploadResponder(LLMeshUploadThread* thread, const LLSD& object_asset): + mThread(thread), + mObjectAsset(object_asset) + { + } + + virtual void completedRaw(U32 status, const std::string& reason, + const LLChannelDescriptors& channels, + const LLIOPipe::buffer_ptr_t& buffer) + { + assert_main_thread(); + + llinfos << "completed" << llendl; + mThread->mPendingUploads--; + mThread->mFinished = true; + } +}; LLMeshRepoThread::LLMeshRepoThread() : LLThread("mesh repo", NULL) @@ -1467,10 +1490,13 @@ void LLMeshUploadThread::run() if(!isDiscarded()) { - LLHTTPClient::post(url, object_asset, new LLHTTPClient::Responder()); + mPendingUploads++; + LLHTTPClient::post(url, object_asset, new LLModelObjectUploadResponder(this,object_asset)); + } + else + { + mFinished = true; } - - mFinished = true; } void LLMeshUploadThread::uploadModel(LLMeshUploadData& data) -- cgit v1.2.3