summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorJosh Bell <josh@lindenlab.com>2007-03-30 17:23:42 +0000
committerJosh Bell <josh@lindenlab.com>2007-03-30 17:23:42 +0000
commitffc6680d956069625fc1fe5da133bdf7922cea83 (patch)
treedbf0ec81a057e87ba1e19dc1f320ed9989104673 /indra
parentf01a90050fcf650b5655f494fff22e265b3ec312 (diff)
Merge of final upload-queue changes from Branch_1-13-4 --> release
svn merge -r 59496:59497 svn+ssh://svn.lindenlab.com/svn/linden/branches/Branch_1-13-4 --> release svn merge -r 59530:59531 svn+ssh://svn.lindenlab.com/svn/linden/branches/Branch_1-13-4 --> release svn merge -r 59827:59828 svn+ssh://svn.lindenlab.com/svn/linden/branches/Branch_1-13-4 --> release svn merge -r 59315:59316 svn+ssh://svn.lindenlab.com/svn/linden/branches/maintenance --> release In order, that's: * back out upload-queue * apply a subset * apply the full thing * re-merge the addition of the DELETE REST Most of which turns into a no-op. Reviewed by don.
Diffstat (limited to 'indra')
-rw-r--r--indra/llmessage/llassetstorage.cpp13
-rw-r--r--indra/llmessage/llhttpassetstorage.cpp44
2 files changed, 34 insertions, 23 deletions
diff --git a/indra/llmessage/llassetstorage.cpp b/indra/llmessage/llassetstorage.cpp
index 873e8fa9db..5b758c88b4 100644
--- a/indra/llmessage/llassetstorage.cpp
+++ b/indra/llmessage/llassetstorage.cpp
@@ -415,20 +415,21 @@ void LLAssetStorage::getAssetData(const LLUUID uuid, LLAssetType::EType type, vo
if (callback == tmp->mDownCallback && user_data == tmp->mUserData)
{
// this is a duplicate from the same subsystem - throw it away
- llinfos << "Discarding duplicate request for UUID " << uuid << llendl;
+ llwarns << "Discarding duplicate request for asset " << uuid
+ << "." << LLAssetType::lookup(type) << llendl;
return;
}
- else
- {
- llinfos << "Adding additional non-duplicate request for UUID " << uuid << llendl;
- }
// this is a duplicate request
// queue the request, but don't actually ask for it again
duplicate = TRUE;
- break;
}
}
+ if (duplicate)
+ {
+ llinfos << "Adding additional non-duplicate request for asset " << uuid
+ << "." << LLAssetType::lookup(type) << llendl;
+ }
// This can be overridden by subclasses
_queueDataRequest(uuid, type, callback, user_data, duplicate, is_priority);
diff --git a/indra/llmessage/llhttpassetstorage.cpp b/indra/llmessage/llhttpassetstorage.cpp
index a4eebed504..7cb6f5f95a 100644
--- a/indra/llmessage/llhttpassetstorage.cpp
+++ b/indra/llmessage/llhttpassetstorage.cpp
@@ -19,7 +19,7 @@
#include "zlib/zlib.h"
-const U32 MAX_RUNNING_REQUESTS = 4;
+const U32 MAX_RUNNING_REQUESTS = 1;
const F32 MAX_PROCESSING_TIME = 0.005f;
const S32 CURL_XFER_BUFFER_SIZE = 65536;
// Try for 30 minutes for now.
@@ -58,6 +58,7 @@ public:
virtual ~LLHTTPAssetRequest();
void setupCurlHandle();
+ void cleanupCurlHandle();
void prepareCompressedUpload();
void finishCompressedUpload();
@@ -121,16 +122,7 @@ LLHTTPAssetRequest::~LLHTTPAssetRequest()
if (mCurlHandle)
{
curl_multi_remove_handle(mCurlMultiHandle, mCurlHandle);
- curl_easy_cleanup(mCurlHandle);
- if (mAssetStoragep)
- {
- // Terminating a request. Thus upload or download is no longer pending.
- mAssetStoragep->removeRunningRequest(mRequestType, this);
- }
- else
- {
- llerrs << "LLHTTPAssetRequest::~LLHTTPAssetRequest - No asset storage associated with this request!" << llendl;
- }
+ cleanupCurlHandle();
}
if (mHTTPHeaders)
{
@@ -255,6 +247,21 @@ void LLHTTPAssetRequest::setupCurlHandle()
}
}
+void LLHTTPAssetRequest::cleanupCurlHandle()
+{
+ curl_easy_cleanup(mCurlHandle);
+ if (mAssetStoragep)
+ {
+ // Terminating a request. Thus upload or download is no longer pending.
+ mAssetStoragep->removeRunningRequest(mRequestType, this);
+ }
+ else
+ {
+ llerrs << "LLHTTPAssetRequest::~LLHTTPAssetRequest - No asset storage associated with this request!" << llendl;
+ }
+ mCurlHandle = NULL;
+}
+
void LLHTTPAssetRequest::prepareCompressedUpload()
{
mZStream.next_in = Z_NULL;
@@ -663,7 +670,7 @@ void LLHTTPAssetStorage::checkForTimeouts()
{
CURLMcode mcode;
LLAssetRequest *req;
- while (req = findNextRequest(mPendingDownloads, mRunningDownloads))
+ while ( (req = findNextRequest(mPendingDownloads, mRunningDownloads)) )
{
// Setup this curl download request
// We need to generate a new request here
@@ -689,7 +696,8 @@ void LLHTTPAssetStorage::checkForTimeouts()
{
// Failure. Deleting the pending request will remove it from the running
// queue, and push it to the end of the pending queue.
- deletePendingRequest(RT_DOWNLOAD, req->getType(), req->getUUID());
+ new_req->cleanupCurlHandle();
+ deletePendingRequest(RT_DOWNLOAD, new_req->getType(), new_req->getUUID());
break;
}
else
@@ -698,7 +706,7 @@ void LLHTTPAssetStorage::checkForTimeouts()
}
}
- while (req = findNextRequest(mPendingUploads, mRunningUploads))
+ while ( (req = findNextRequest(mPendingUploads, mRunningUploads)) )
{
// setup this curl upload request
@@ -742,7 +750,8 @@ void LLHTTPAssetStorage::checkForTimeouts()
{
// Failure. Deleting the pending request will remove it from the running
// queue, and push it to the end of the pending queue.
- deletePendingRequest(RT_UPLOAD, req->getType(), req->getUUID());
+ new_req->cleanupCurlHandle();
+ deletePendingRequest(RT_UPLOAD, new_req->getType(), new_req->getUUID());
break;
}
else
@@ -752,7 +761,7 @@ void LLHTTPAssetStorage::checkForTimeouts()
// Pending upload will have been flagged by the request
}
- while (req = findNextRequest(mPendingLocalUploads, mRunningLocalUploads))
+ while ( (req = findNextRequest(mPendingLocalUploads, mRunningLocalUploads)) )
{
// setup this curl upload request
LLVFile file(mVFS, req->getUUID(), req->getType());
@@ -781,7 +790,8 @@ void LLHTTPAssetStorage::checkForTimeouts()
{
// Failure. Deleting the pending request will remove it from the running
// queue, and push it to the end of the pending queue.
- deletePendingRequest(RT_LOCALUPLOAD, req->getType(), req->getUUID());
+ new_req->cleanupCurlHandle();
+ deletePendingRequest(RT_LOCALUPLOAD, new_req->getType(), new_req->getUUID());
break;
}
else