diff options
Diffstat (limited to 'linden/indra/newview/lltexturefetch.cpp')
-rw-r--r-- | linden/indra/newview/lltexturefetch.cpp | 55 |
1 files changed, 2 insertions, 53 deletions
diff --git a/linden/indra/newview/lltexturefetch.cpp b/linden/indra/newview/lltexturefetch.cpp index ab867a6..bdad2b8 100644 --- a/linden/indra/newview/lltexturefetch.cpp +++ b/linden/indra/newview/lltexturefetch.cpp | |||
@@ -874,15 +874,6 @@ bool LLTextureFetchWorker::doWork(S32 param) | |||
874 | } | 874 | } |
875 | } | 875 | } |
876 | 876 | ||
877 | // *TODO: remove this hack when not needed anymore | ||
878 | S32 buggy_range_fudge = 0; | ||
879 | if (LLTextureFetch::hasBuggyHTTPRange()) | ||
880 | { | ||
881 | buggy_range_fudge = 1; | ||
882 | resetFormattedData(); // discard any previous data we had | ||
883 | cur_size = 0 ; | ||
884 | } | ||
885 | |||
886 | mRequestedSize = mDesiredSize; | 877 | mRequestedSize = mDesiredSize; |
887 | mRequestedDiscard = mDesiredDiscard; | 878 | mRequestedDiscard = mDesiredDiscard; |
888 | mRequestedSize -= cur_size; | 879 | mRequestedSize -= cur_size; |
@@ -898,7 +889,7 @@ bool LLTextureFetchWorker::doWork(S32 param) | |||
898 | mGetReason.clear(); | 889 | mGetReason.clear(); |
899 | LL_DEBUGS("TextureFetch") << "HTTP GET: " << mID << " Offset: " << offset | 890 | LL_DEBUGS("TextureFetch") << "HTTP GET: " << mID << " Offset: " << offset |
900 | << " Bytes: " << mRequestedSize | 891 | << " Bytes: " << mRequestedSize |
901 | << " Range: " << offset << "-" << offset+mRequestedSize-1+buggy_range_fudge | 892 | << " Range: " << offset << "-" << offset+mRequestedSize-1 |
902 | << " Bandwidth(kbps): " << mFetcher->getTextureBandwidth() << "/" << max_bandwidth | 893 | << " Bandwidth(kbps): " << mFetcher->getTextureBandwidth() << "/" << max_bandwidth |
903 | << LL_ENDL; | 894 | << LL_ENDL; |
904 | setPriority(LLWorkerThread::PRIORITY_LOW | mWorkPriority); | 895 | setPriority(LLWorkerThread::PRIORITY_LOW | mWorkPriority); |
@@ -908,7 +899,7 @@ bool LLTextureFetchWorker::doWork(S32 param) | |||
908 | // Will call callbackHttpGet when curl request completes | 899 | // Will call callbackHttpGet when curl request completes |
909 | std::vector<std::string> headers; | 900 | std::vector<std::string> headers; |
910 | headers.push_back("Accept: image/x-j2c"); | 901 | headers.push_back("Accept: image/x-j2c"); |
911 | res = mFetcher->mCurlGetRequest->getByteRange(mUrl, headers, offset, mRequestedSize + buggy_range_fudge, | 902 | res = mFetcher->mCurlGetRequest->getByteRange(mUrl, headers, offset, mRequestedSize, |
912 | new HTTPGetResponder(mFetcher, mID, LLTimer::getTotalTime(), mRequestedSize, offset)); | 903 | new HTTPGetResponder(mFetcher, mID, LLTimer::getTotalTime(), mRequestedSize, offset)); |
913 | } | 904 | } |
914 | if (!res) | 905 | if (!res) |
@@ -2279,45 +2270,3 @@ void LLTextureFetch::dump() | |||
2279 | << llendl; | 2270 | << llendl; |
2280 | } | 2271 | } |
2281 | } | 2272 | } |
2282 | |||
2283 | // This tries to detect if the sim has this bug: | ||
2284 | // http://opensimulator.org/mantis/view.php?id=5081 | ||
2285 | // | ||
2286 | // *TODO: This is a *HACK and may not work if the grid is heterogenous. | ||
2287 | // Remove it once OpenSim versions in the wild are > 0.7.0.2! | ||
2288 | #include "hippogridmanager.h" | ||
2289 | #include <boost/regex.hpp> | ||
2290 | //static | ||
2291 | bool LLTextureFetch::hasBuggyHTTPRange() | ||
2292 | { | ||
2293 | static std::string s_version; | ||
2294 | static bool buggy = false; | ||
2295 | if ((s_version != gLastVersionChannel) && !gLastVersionChannel.empty()) | ||
2296 | { | ||
2297 | s_version = gLastVersionChannel; | ||
2298 | buggy = false; | ||
2299 | if (gHippoGridManager->getConnectedGrid()->getPlatform() == HippoGridInfo::PLATFORM_OPENSIM) | ||
2300 | { | ||
2301 | std::string ver_string; | ||
2302 | try | ||
2303 | { | ||
2304 | const boost::regex re(".*OpenSim.*?([0-9.]+).+"); | ||
2305 | ver_string = regex_replace(s_version, re, "\\1", boost::match_default); | ||
2306 | } | ||
2307 | catch(std::runtime_error) | ||
2308 | { | ||
2309 | ver_string = "0.0"; | ||
2310 | } | ||
2311 | LLStringUtil::replaceChar(ver_string, '.', '0'); | ||
2312 | ver_string = "0." + ver_string; | ||
2313 | F64 version = atof(ver_string.c_str()); | ||
2314 | // we look for "0.6.8" < version < "0.7.0.3" | ||
2315 | if ((version > 0.00608) && (version < 0.0070003)) | ||
2316 | { | ||
2317 | buggy = true; | ||
2318 | llwarns << "Setting buggy http ranges mode for current sim, because we're on " << s_version << llendl; | ||
2319 | } | ||
2320 | } | ||
2321 | } | ||
2322 | return buggy; | ||
2323 | } | ||