From a5ba9c0eb327d2fb38a39560a34712e844a71a79 Mon Sep 17 00:00:00 2001
From: Monty Brandenberg <monty@lindenlab.com>
Date: Tue, 10 Jul 2012 16:56:38 -0400
Subject: [PATCH] SH-3276  Handle 416 status back from texture fetches as okay.
 A 416 will just mean there's no more data and whatever we have is complete.

---
 indra/newview/lltexturefetch.cpp | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp
index a1f99eeb250..5c395042433 100755
--- a/indra/newview/lltexturefetch.cpp
+++ b/indra/newview/lltexturefetch.cpp
@@ -1364,6 +1364,10 @@ bool LLTextureFetchWorker::doWork(S32 param)
 		}
 		mState = SEND_HTTP_REQ;
 		acquireHttpSemaphore();
+
+		// *NOTE:  You must invoke releaseHttpSemaphore() if you transition
+		// to a state other than SEND_HTTP_REQ or WAIT_HTTP_REQ or abort
+		// the request.
 	}
 
 	if (mState == WAIT_HTTP_RESOURCE2)
@@ -1486,13 +1490,16 @@ bool LLTextureFetchWorker::doWork(S32 param)
 				{
 					LL_INFOS_ONCE("Texture") << "Texture server busy (503): " << mUrl << LL_ENDL;
 				}
+				else if (http_not_sat == mGetStatus)
+				{
+					// Allowed, we'll accept whatever data we have as complete.
+					mHaveAllData = TRUE;
+				}
 				else
 				{
 					llinfos << "HTTP GET failed for: " << mUrl
 							<< " Status: " << mGetStatus.toHex()
 							<< " Reason: '" << mGetReason << "'"
-						// *FIXME:  Add retry info for reporting purposes...
-						// << " Attempt:" << mHTTPFailCount+1 << "/" << max_attempts
 							<< llendl;
 				}
 
@@ -1839,7 +1846,7 @@ void LLTextureFetchWorker::onCompleted(LLCore::HttpHandle handle, LLCore::HttpRe
 		success = false;
 		std::string reason(status.toString());
 		setGetStatus(status, reason);
- 		llwarns << "CURL GET FAILED, status: " << status.toHex()
+		llwarns << "CURL GET FAILED, status: " << status.toHex()
 				<< " reason: " << reason << llendl;
 	}
 	else
-- 
GitLab