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.
meow-7.2.2
Josh Bell 2007-03-30 17:23:42 +00:00
parent f01a90050f
commit ffc6680d95
2 changed files with 34 additions and 23 deletions

View File

@ -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);

View File

@ -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