MAINT-8730 Remove unused fetchFeatureTable code
parent
30be0b0560
commit
d98df5ec2b
|
|
@ -3703,13 +3703,13 @@
|
|||
<key>FeatureManagerHTTPTable</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Base directory for HTTP feature/gpu table fetches</string>
|
||||
<string>Deprecated</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<integer>0</integer>
|
||||
<key>Type</key>
|
||||
<string>String</string>
|
||||
<key>Value</key>
|
||||
<string>http://viewer-settings.secondlife.com</string>
|
||||
<string></string>
|
||||
</map>
|
||||
<key>FPSLogFrequency</key>
|
||||
<map>
|
||||
|
|
|
|||
|
|
@ -62,13 +62,10 @@
|
|||
|
||||
#if LL_DARWIN
|
||||
const char FEATURE_TABLE_FILENAME[] = "featuretable_mac.txt";
|
||||
const char FEATURE_TABLE_VER_FILENAME[] = "featuretable_mac.%s.txt";
|
||||
#elif LL_LINUX
|
||||
const char FEATURE_TABLE_FILENAME[] = "featuretable_linux.txt";
|
||||
const char FEATURE_TABLE_VER_FILENAME[] = "featuretable_linux.%s.txt";
|
||||
#else
|
||||
const char FEATURE_TABLE_FILENAME[] = "featuretable.txt";
|
||||
const char FEATURE_TABLE_VER_FILENAME[] = "featuretable.%s.txt";
|
||||
#endif
|
||||
|
||||
#if 0 // consuming code in #if 0 below
|
||||
|
|
@ -273,33 +270,11 @@ bool LLFeatureManager::loadFeatureTables()
|
|||
app_path += gDirUtilp->getDirDelimiter();
|
||||
|
||||
std::string filename;
|
||||
std::string http_filename;
|
||||
filename = FEATURE_TABLE_FILENAME;
|
||||
http_filename = llformat(FEATURE_TABLE_VER_FILENAME, LLVersionInfo::getVersion().c_str());
|
||||
|
||||
app_path += filename;
|
||||
|
||||
// second table is downloaded with HTTP - note that this will only be used on the run _after_ it is downloaded
|
||||
std::string http_path = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, http_filename);
|
||||
|
||||
// use HTTP table if it exists
|
||||
std::string path;
|
||||
bool parse_ok = false;
|
||||
if (gDirUtilp->fileExists(http_path))
|
||||
{
|
||||
parse_ok = parseFeatureTable(http_path);
|
||||
if (!parse_ok)
|
||||
{
|
||||
// the HTTP table failed to parse, so delete it
|
||||
LLFile::remove(http_path);
|
||||
LL_WARNS("RenderInit") << "Removed invalid feature table '" << http_path << "'" << LL_ENDL;
|
||||
}
|
||||
}
|
||||
|
||||
if (!parse_ok)
|
||||
{
|
||||
parse_ok = parseFeatureTable(app_path);
|
||||
}
|
||||
bool parse_ok = parseFeatureTable(app_path);
|
||||
|
||||
return parse_ok;
|
||||
}
|
||||
|
|
@ -486,70 +461,6 @@ bool LLFeatureManager::loadGPUClass()
|
|||
return true; // indicates that a gpu value was established
|
||||
}
|
||||
|
||||
void LLFeatureManager::fetchFeatureTableCoro(std::string tableName)
|
||||
{
|
||||
LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID);
|
||||
LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t
|
||||
httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("FeatureManagerHTTPTable", httpPolicy));
|
||||
LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest);
|
||||
|
||||
const std::string base = gSavedSettings.getString("FeatureManagerHTTPTable");
|
||||
|
||||
|
||||
#if LL_WINDOWS
|
||||
std::string os_string = LLOSInfo::instance().getOSStringSimple();
|
||||
std::string filename;
|
||||
|
||||
if (os_string.find("Microsoft Windows XP") == 0)
|
||||
{
|
||||
filename = llformat(tableName.c_str(), "_xp", LLVersionInfo::getVersion().c_str());
|
||||
}
|
||||
else
|
||||
{
|
||||
filename = llformat(tableName.c_str(), "", LLVersionInfo::getVersion().c_str());
|
||||
}
|
||||
#else
|
||||
const std::string filename = llformat(tableName.c_str(), LLVersionInfo::getVersion().c_str());
|
||||
#endif
|
||||
|
||||
std::string url = base + "/" + filename;
|
||||
// testing url below
|
||||
//url = "http://viewer-settings.secondlife.com/featuretable.2.1.1.208406.txt";
|
||||
const std::string path = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, filename);
|
||||
|
||||
|
||||
LL_INFOS() << "LLFeatureManager fetching " << url << " into " << path << LL_ENDL;
|
||||
|
||||
LLSD result = httpAdapter->getRawAndSuspend(httpRequest, url);
|
||||
|
||||
LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS];
|
||||
LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults);
|
||||
|
||||
if (status)
|
||||
{ // There was a newer feature table on the server. We've grabbed it and now should write it.
|
||||
// write to file
|
||||
const LLSD::Binary &raw = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS_RAW].asBinary();
|
||||
|
||||
LL_INFOS() << "writing feature table to " << path << LL_ENDL;
|
||||
|
||||
S32 size = raw.size();
|
||||
if (size > 0)
|
||||
{
|
||||
// write to file
|
||||
LLAPRFile out(path, LL_APR_WB);
|
||||
out.write(raw.data(), size);
|
||||
out.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// fetch table(s) from a website (S3)
|
||||
void LLFeatureManager::fetchHTTPTables()
|
||||
{
|
||||
LLCoros::instance().launch("LLFeatureManager::fetchFeatureTableCoro",
|
||||
boost::bind(&LLFeatureManager::fetchFeatureTableCoro, this, FEATURE_TABLE_VER_FILENAME));
|
||||
}
|
||||
|
||||
void LLFeatureManager::cleanupFeatureTables()
|
||||
{
|
||||
std::for_each(mMaskList.begin(), mMaskList.end(), DeletePairedPointer());
|
||||
|
|
|
|||
|
|
@ -145,9 +145,6 @@ public:
|
|||
// in the skip list if true
|
||||
void applyFeatures(bool skipFeatures);
|
||||
|
||||
// load the dynamic GPU/feature table from a website
|
||||
void fetchHTTPTables();
|
||||
|
||||
LLSD getRecommendedSettingsMap();
|
||||
|
||||
protected:
|
||||
|
|
@ -158,8 +155,6 @@ protected:
|
|||
|
||||
void initBaseMask();
|
||||
|
||||
void fetchFeatureTableCoro(std::string name);
|
||||
|
||||
std::map<std::string, LLFeatureList *> mMaskList;
|
||||
std::set<std::string> mSkippedFeatures;
|
||||
BOOL mInited;
|
||||
|
|
|
|||
Loading…
Reference in New Issue