aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/lltexturefetch.cpp
diff options
context:
space:
mode:
authorDavid Seikel2011-06-04 00:17:28 +1000
committerDavid Seikel2011-06-04 00:17:28 +1000
commit492eaaf4eec82327116f2605e3d8becf94bec1b3 (patch)
treedcddd674cb4861445c3ec5aaa59325b99a437614 /linden/indra/newview/lltexturefetch.cpp
parentSet the real bare minimum prim size to 0.00001, as 0 sized objects cause bugs. (diff)
parentFixing the menu to actually use its color options reveals how broken the whol... (diff)
downloadmeta-impy-492eaaf4eec82327116f2605e3d8becf94bec1b3.zip
meta-impy-492eaaf4eec82327116f2605e3d8becf94bec1b3.tar.gz
meta-impy-492eaaf4eec82327116f2605e3d8becf94bec1b3.tar.bz2
meta-impy-492eaaf4eec82327116f2605e3d8becf94bec1b3.tar.xz
Merge branch 'next' of git://github.com/jacek/imprudence into next
Conflicts (manually merged): linden/indra/llcommon/llversionviewer.h linden/indra/llvfs/lldir.cpp linden/indra/llvfs/lldir_mac.cpp linden/indra/newview/CMakeLists.txt linden/indra/newview/English.lproj/InfoPlist.strings linden/indra/newview/Info-Imprudence.plist linden/indra/newview/Info-meta-impy.plist linden/indra/newview/llappviewer.cpp linden/indra/newview/llpanellogin.cpp linden/indra/newview/packaging/mac/Info.plist.in linden/indra/newview/res/viewerRes.rc linden/indra/newview/skins/default/xui/en-us/floater_about.xml linden/indra/newview/skins/default/xui/en-us/panel_preferences_advanced.xml linden/indra/newview/skins/default/xui/en-us/panel_preferences_graphics1.xml linden/indra/newview/skins/default/xui/en-us/panel_preferences_im.xml linden/indra/newview/skins/default/xui/en-us/panel_preferences_skins.xml linden/indra/newview/skins/default/xui/en-us/panel_preferences_web.xml linden/indra/newview/skins/default/xui/zh/menu_viewer.xml linden/indra/newview/skins/default/xui/zh/panel_group_general.xml linden/indra/newview/viewer_manifest.py linden/indra/newview/viewerversion.cpp linden/indra/newview/viewerversion.h linden/install.xml Also some post merge tweaks.
Diffstat (limited to 'linden/indra/newview/lltexturefetch.cpp')
-rw-r--r--linden/indra/newview/lltexturefetch.cpp55
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
2291bool 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}