diff options
| -rwxr-xr-x | indra/newview/lltexturefetch.cpp | 15 | ||||
| -rwxr-xr-x | indra/newview/lltexturefetch.h | 3 | ||||
| -rwxr-xr-x | indra/newview/llviewertexture.cpp | 20 | ||||
| -rwxr-xr-x | indra/newview/llviewertexture.h | 4 | 
4 files changed, 31 insertions, 11 deletions
| diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index 2e6fb160d5..5a6338d9d8 100755 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -382,6 +382,8 @@ public:  	void setCanUseHTTP(bool can_use_http) { mCanUseHTTP = can_use_http; }  	bool getCanUseHTTP() const { return mCanUseHTTP; } +	void setUrl(const std::string& url) { mUrl = url; } +  	LLTextureFetch & getFetcher() { return *mFetcher; }  	// Inherited from LLCore::HttpHandler @@ -1291,7 +1293,7 @@ bool LLTextureFetchWorker::doWork(S32 param)  				std::string http_url = region->getHttpUrl() ;  				if (!http_url.empty())  				{ -					mUrl = http_url + "/?texture_id=" + mID.asString().c_str(); +					setUrl(http_url + "/?texture_id=" + mID.asString().c_str());  					mWriteToCacheState = CAN_WRITE ; //because this texture has a fixed texture id.  				}  				else @@ -1900,7 +1902,7 @@ void LLTextureFetchWorker::onCompleted(LLCore::HttpHandle handle, LLCore::HttpRe  	if (mFakeFailure)  	{  		llwarns << "For debugging, setting fake failure status for texture " << mID << llendl; -		response->setStatus(LLCore::HttpStatus(404)); +		response->setStatus(LLCore::HttpStatus(500));  	}  	bool success = true;  	bool partial = false; @@ -1918,11 +1920,11 @@ void LLTextureFetchWorker::onCompleted(LLCore::HttpHandle handle, LLCore::HttpRe  // 			<< " offset: " << offset << " length: " << length  // 			<< llendl; +	std::string reason(status.toString()); +	setGetStatus(status, reason);  	if (! status)  	{  		success = false; -		std::string reason(status.toString()); -		setGetStatus(status, reason);  		llwarns << "CURL GET FAILED, status: " << status.toHex()  				<< " reason: " << reason << llendl;  	} @@ -2535,6 +2537,7 @@ bool LLTextureFetch::createRequest(FTType f_type, const std::string& url, const  		worker->setImagePriority(priority);  		worker->setDesiredDiscard(desired_discard, desired_size);  		worker->setCanUseHTTP(can_use_http); +		worker->setUrl(url);  		worker->setFakeFailure(fake_failure);  		if (!worker->haveWork())  		{ @@ -2741,7 +2744,8 @@ LLTextureFetchWorker* LLTextureFetch::getWorker(const LLUUID& id)  // Threads:  T*  bool LLTextureFetch::getRequestFinished(const LLUUID& id, S32& discard_level, -										LLPointer<LLImageRaw>& raw, LLPointer<LLImageRaw>& aux) +										LLPointer<LLImageRaw>& raw, LLPointer<LLImageRaw>& aux, +										LLCore::HttpStatus& last_http_get_status)  {  	bool res = false;  	LLTextureFetchWorker* worker = getWorker(id); @@ -2763,6 +2767,7 @@ bool LLTextureFetch::getRequestFinished(const LLUUID& id, S32& discard_level,  		else if (worker->checkWork())  		{  			worker->lockWorkMutex();									// +Mw +			last_http_get_status = worker->mGetStatus;  			discard_level = worker->mDecodedDiscard;  			raw = worker->mRawImage;  			aux = worker->mAuxImage; diff --git a/indra/newview/lltexturefetch.h b/indra/newview/lltexturefetch.h index b99480d18e..9f77d58727 100755 --- a/indra/newview/lltexturefetch.h +++ b/indra/newview/lltexturefetch.h @@ -95,7 +95,8 @@ public:  	// Threads:  T*  	bool getRequestFinished(const LLUUID& id, S32& discard_level, -							LLPointer<LLImageRaw>& raw, LLPointer<LLImageRaw>& aux); +							LLPointer<LLImageRaw>& raw, LLPointer<LLImageRaw>& aux, +							LLCore::HttpStatus& last_http_get_status);  	// Threads:  T*  	bool updateRequestPriority(const LLUUID& id, F32 priority); diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index a157600cc9..7a1afb1238 100755 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -1760,7 +1760,8 @@ bool LLViewerFetchedTexture::updateFetch()  		if (mRawImage.notNull()) sRawCount--;  		if (mAuxRawImage.notNull()) sAuxCount--; -		bool finished = LLAppViewer::getTextureFetch()->getRequestFinished(getID(), fetch_discard, mRawImage, mAuxRawImage); +		bool finished = LLAppViewer::getTextureFetch()->getRequestFinished(getID(), fetch_discard, mRawImage, mAuxRawImage, +																		   mLastHttpGetStatus);  		if (mRawImage.notNull()) sRawCount++;  		if (mAuxRawImage.notNull()) sAuxCount++;  		if (finished) @@ -1825,14 +1826,25 @@ bool LLViewerFetchedTexture::updateFetch()  				// We finished but received no data  				if (current_discard < 0)  				{ -					const S32 MAX_FETCH_FAILURE = 1; +					const S32 MAX_FETCH_FAILURE = 3;  					mFetchFailureCount++; -					llwarns << "Fetch failure for " << mID << " failure count " << mFetchFailureCount << llendl; -					if (getFTType() != FTT_SERVER_BAKE || mFetchFailureCount >= MAX_FETCH_FAILURE) +					llwarns << "Fetch failure for " << mID << " failure count " << mFetchFailureCount +							<< " status " << mLastHttpGetStatus.toHex() << llendl; +					// Will retry server-bake textures under a limited set of circumstances. +					if (getFTType() == FTT_SERVER_BAKE &&  +						mLastHttpGetStatus.isHttpStatus() &&  +						mLastHttpGetStatus.mType >= 500 &&  +						mLastHttpGetStatus.mType <= 599 && // Only retry 5xx failures. +						mFetchFailureCount < MAX_FETCH_FAILURE) +					{ +						llwarns << "Will retry fetch" << llendl; +					} +					else // Otherwise, assume the image is missing.  					{  						llwarns << "!mIsFetching, setting as missing, decode_priority " << decode_priority  								<< " mRawDiscardLevel " << mRawDiscardLevel  								<< " current_discard " << current_discard +								<< " stats " << mLastHttpGetStatus.toHex()  								<< llendl;  						setIsMissingAsset();  						desired_discard = -1; diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h index 320e6f8630..91e903ffd6 100755 --- a/indra/newview/llviewertexture.h +++ b/indra/newview/llviewertexture.h @@ -34,6 +34,7 @@  #include "llgltypes.h"  #include "llrender.h"  #include "llmetricperformancetester.h" +#include "httpcommon.h"  #include <map>  #include <list> @@ -446,7 +447,8 @@ protected:  	S8  mIsRawImageValid;  	S8  mHasFetcher;				// We've made a fecth request  	S8  mIsFetching;				// Fetch request is active -	bool mCanUseHTTP ;              //This texture can be fetched through http if true. +	bool mCanUseHTTP;              //This texture can be fetched through http if true. +	LLCore::HttpStatus mLastHttpGetStatus; // Result of the most recently completed http request for this texture.  	FTType mFTType; // What category of image is this - map tile, server bake, etc?  	mutable BOOL mIsMissingAsset;		// True if we know that there is no image asset with this image id in the database.		 | 
