diff options
author | Ima Mechanique <ima.mechanique@secondlife.com> | 2014-02-05 16:29:43 +0000 |
---|---|---|
committer | Ima Mechanique <ima.mechanique@secondlife.com> | 2014-02-05 16:29:43 +0000 |
commit | 5551e8f04c84d1427fc39b0927eebc6dd58a772f (patch) | |
tree | 319dbd0162687331cfb1bf04d12a6cea8209ad84 /indra | |
parent | 566b10e2250e484b2d3211565d387c3c73864e82 (diff) |
Checking version for cached files so older versions cannot sneak through on upgrading of format.
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llsyntaxid.cpp | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/indra/newview/llsyntaxid.cpp b/indra/newview/llsyntaxid.cpp index 4d7cc550af..4b84098b39 100644 --- a/indra/newview/llsyntaxid.cpp +++ b/indra/newview/llsyntaxid.cpp @@ -371,6 +371,10 @@ void LLSyntaxIdLSL::loadKeywordsIntoLLSD() << "Trying to open cached or default keyword file ;-)" << LL_ENDL; + // Is this the right thing to do, or should we leave the old content + // even if it isn't entirely accurate anymore? + sKeywordsXml = LLSD().emptyMap(); + LLSD content; llifstream file; file.open(mFullFileSpec); @@ -379,16 +383,25 @@ void LLSyntaxIdLSL::loadKeywordsIntoLLSD() sLoaded = (bool)LLSDSerialize::fromXML(content, file); if (!sLoaded) { - LL_ERRS("SyntaxLSL") << "Unable to deserialise file: " << mFullFileSpec << LL_ENDL; - - // Is this the right thing to do, or should we leave the old content - // even if it isn't entirely accurate anymore? - sKeywordsXml = LLSD().emptyMap(); + LL_ERRS("SyntaxLSL") + << "Unable to deserialise file: " + << mFullFileSpec << LL_ENDL; } else { - sKeywordsXml = content; - LL_INFOS("SyntaxLSL") << "Deserialised file: " << mFullFileSpec << LL_ENDL; + if (isSupportedVersion(content)) + { + sKeywordsXml = content; + LL_INFOS("SyntaxLSL") + << "Deserialised file: " << mFullFileSpec << LL_ENDL; + } + else + { + LLSyntaxIdLSL::sLoaded = false; + LLSyntaxIdLSL::sLoadFailed = true; + LL_WARNS("SyntaxLSL") + << "Unknown or unsupported version of syntax file." << LL_ENDL; + } } } else |