diff options
author | Palmer <palmer@lindenlab.com> | 2010-07-22 15:20:45 -0700 |
---|---|---|
committer | Palmer <palmer@lindenlab.com> | 2010-07-22 15:20:45 -0700 |
commit | 7d73afe8957b64a5b3620d162265484618aee9fc (patch) | |
tree | a1a260bbca0cd034b78f4a65834775fcf2208a0c /indra/newview | |
parent | 35837f2d382120088572ec87006238c79973e493 (diff) |
EXT-7145 - Handle http redirects in viewer properly. Didn't work before.
Reviewed by Bao and Babbage
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/lltexturefetch.cpp | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index ceed90e210..dddfed097d 100644 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -290,8 +290,8 @@ class HTTPGetResponder : public LLCurl::Responder { LOG_CLASS(HTTPGetResponder); public: - HTTPGetResponder(LLTextureFetch* fetcher, const LLUUID& id, U64 startTime, S32 requestedSize, U32 offset) - : mFetcher(fetcher), mID(id), mStartTime(startTime), mRequestedSize(requestedSize), mOffset(offset) + HTTPGetResponder(LLTextureFetch* fetcher, const LLUUID& id, U64 startTime, S32 requestedSize, U32 offset, bool redir) + : mFetcher(fetcher), mID(id), mStartTime(startTime), mRequestedSize(requestedSize), mOffset(offset), mFollowRedir(redir) { } ~HTTPGetResponder() @@ -344,6 +344,11 @@ public: llwarns << "Worker not found: " << mID << llendl; } } + + virtual bool followRedir() + { + return mFollowRedir; + } private: LLTextureFetch* mFetcher; @@ -351,6 +356,7 @@ private: U64 mStartTime; S32 mRequestedSize; U32 mOffset; + bool mFollowRedir; }; ////////////////////////////////////////////////////////////////////////////// @@ -897,7 +903,7 @@ bool LLTextureFetchWorker::doWork(S32 param) std::vector<std::string> headers; headers.push_back("Accept: image/x-j2c"); res = mFetcher->mCurlGetRequest->getByteRange(mUrl, headers, offset, mRequestedSize, - new HTTPGetResponder(mFetcher, mID, LLTimer::getTotalTime(), mRequestedSize, offset)); + new HTTPGetResponder(mFetcher, mID, LLTimer::getTotalTime(), mRequestedSize, offset, true)); } if (!res) { @@ -945,17 +951,6 @@ bool LLTextureFetchWorker::doWork(S32 param) max_attempts = mHTTPFailCount+1; // Keep retrying LL_INFOS_ONCE("Texture") << "Texture server busy (503): " << mUrl << LL_ENDL; } - else if(mGetStatus >= HTTP_MULTIPLE_CHOICES && mGetStatus < HTTP_BAD_REQUEST) //http re-direct - { - ++mHTTPFailCount; - max_attempts = 5 ; //try at most 5 times to avoid infinite redirection loop. - - llwarns << "HTTP GET failed because of redirection: " << mUrl - << " Status: " << mGetStatus << " Reason: '" << mGetReason << llendl ; - - //assign to the new url - mUrl = mGetReason ; - } else { const S32 HTTP_MAX_RETRY_COUNT = 3; |