summaryrefslogtreecommitdiff
path: root/indra/newview/llfeaturemanager.cpp
diff options
context:
space:
mode:
authorAndrey Lihatskiy <andreylproductengine@lindenlab.com>2018-06-11 14:28:30 +0300
committerAndrey Lihatskiy <andreylproductengine@lindenlab.com>2018-06-11 14:28:30 +0300
commit1b236217560aeb81d5eea5a6b67b1f9896b005a8 (patch)
treeb69705b8ef9831b4725fa3023626d87ec4b1809a /indra/newview/llfeaturemanager.cpp
parent546fc96f01298fe16f1cb0454e65569c77c44090 (diff)
parent2761c1c7c2fdb6cbfe610be7e2f4f8753271d36f (diff)
Merged lindenlab/viewer-neko into default
Diffstat (limited to 'indra/newview/llfeaturemanager.cpp')
-rw-r--r--indra/newview/llfeaturemanager.cpp91
1 files changed, 1 insertions, 90 deletions
diff --git a/indra/newview/llfeaturemanager.cpp b/indra/newview/llfeaturemanager.cpp
index 8f1641e908..487496df9a 100644
--- a/indra/newview/llfeaturemanager.cpp
+++ b/indra/newview/llfeaturemanager.cpp
@@ -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;
}
@@ -495,70 +470,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());