diff options
author | Glenn Glazer <coyot@lindenlab.com> | 2017-05-23 07:59:15 -0700 |
---|---|---|
committer | Glenn Glazer <coyot@lindenlab.com> | 2017-05-23 07:59:15 -0700 |
commit | 3fda9bea31327f166dd1067f7e5c9ce251b40289 (patch) | |
tree | d7bbf85ac5d6b15ed7d5db8b8b67a1cccbaca4f9 /indra/newview/llviewerassetupload.cpp | |
parent | 4bf1f1d618d61f0cc2ec0dd22cea7d1c5b909b8f (diff) | |
parent | cf5865c6e2b27918b526431ccc4309bfc702534e (diff) |
pull from gate
Diffstat (limited to 'indra/newview/llviewerassetupload.cpp')
-rw-r--r-- | indra/newview/llviewerassetupload.cpp | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/indra/newview/llviewerassetupload.cpp b/indra/newview/llviewerassetupload.cpp index 49d29c0e4e..01b4fcfbe1 100644 --- a/indra/newview/llviewerassetupload.cpp +++ b/indra/newview/llviewerassetupload.cpp @@ -53,6 +53,8 @@ void dialog_refresh_all(); +static const U32 LL_ASSET_UPLOAD_TIMEOUT_SEC = 60; + LLResourceUploadInfo::LLResourceUploadInfo(LLTransactionID transactId, LLAssetType::EType assetType, std::string name, std::string description, S32 compressionInfo, LLFolderType::EType destinationType, @@ -678,6 +680,8 @@ void LLViewerAssetUpload::AssetInventoryUploadCoproc(LLCoreHttpUtil::HttpCorouti const LLUUID &id, std::string url, LLResourceUploadInfo::ptr_t uploadInfo) { LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); + LLCore::HttpOptions::ptr_t httpOptions(new LLCore::HttpOptions); + httpOptions->setTimeout(LL_ASSET_UPLOAD_TIMEOUT_SEC); LLSD result = uploadInfo->prepareUpload(); uploadInfo->logPreparedUpload(); @@ -699,7 +703,7 @@ void LLViewerAssetUpload::AssetInventoryUploadCoproc(LLCoreHttpUtil::HttpCorouti LLSD body = uploadInfo->generatePostBody(); - result = httpAdapter->postAndSuspend(httpRequest, url, body); + result = httpAdapter->postAndSuspend(httpRequest, url, body, httpOptions); LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS]; LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults); @@ -717,7 +721,7 @@ void LLViewerAssetUpload::AssetInventoryUploadCoproc(LLCoreHttpUtil::HttpCorouti bool success = false; if (!uploader.empty() && uploadInfo->getAssetId().notNull()) { - result = httpAdapter->postFileAndSuspend(httpRequest, uploader, uploadInfo->getAssetId(), uploadInfo->getAssetType()); + result = httpAdapter->postFileAndSuspend(httpRequest, uploader, uploadInfo->getAssetId(), uploadInfo->getAssetType(), httpOptions); httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS]; status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults); @@ -811,14 +815,19 @@ void LLViewerAssetUpload::HandleUploadError(LLCore::HttpStatus status, LLSD &res } else { - if (status.getType() == 499) - { - reason = "The server is experiencing unexpected difficulties."; - } - else + switch (status.getType()) { - reason = "Error in upload request. Please visit " - "http://secondlife.com/support for help fixing this problem."; + case 404: + reason = LLTrans::getString("AssetUploadServerUnreacheble"); + break; + case 499: + reason = LLTrans::getString("AssetUploadServerDifficulties"); + break; + case 503: + reason = LLTrans::getString("AssetUploadServerUnavaliable"); + break; + default: + reason = LLTrans::getString("AssetUploadRequestInvalid"); } } |