diff options
author | Oz Linden <oz@lindenlab.com> | 2015-04-02 21:43:34 -0400 |
---|---|---|
committer | Oz Linden <oz@lindenlab.com> | 2015-04-02 21:43:34 -0400 |
commit | 66bc5107863e8226e91818cd9d3c075d0514dbe5 (patch) | |
tree | eff63c1bff7fa3b3d74bee754099d556c0237aae /indra/newview/llnotificationstorage.cpp | |
parent | 4aafdfd1c6ee76484b83a4e91a73af357aba0de7 (diff) |
detect xml errors in parsing xml files and remove those files
Diffstat (limited to 'indra/newview/llnotificationstorage.cpp')
-rwxr-xr-x | indra/newview/llnotificationstorage.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/indra/newview/llnotificationstorage.cpp b/indra/newview/llnotificationstorage.cpp index e9970de58c..3418b33d37 100755 --- a/indra/newview/llnotificationstorage.cpp +++ b/indra/newview/llnotificationstorage.cpp @@ -123,14 +123,18 @@ bool LLNotificationStorage::readNotifications(LLSD& pNotificationData, bool is_n { LLPointer<LLSDParser> parser = new LLSDXMLParser(); didFileRead = (parser->parse(notifyFile, pNotificationData, LLSDSerialize::SIZE_UNLIMITED) >= 0); + notifyFile.close(); + if (!didFileRead) { LL_WARNS("LLNotificationStorage") << "Failed to parse open notifications from file '" << mFileName - << "'" << LL_ENDL; + << "'" << LL_ENDL; + LLFile::remove(filename); + LL_WARNS("LLNotificationStorage") << "Removed invalid open notifications file '" << mFileName + << "'" << LL_ENDL; } } - - LL_INFOS("LLNotificationStorage") << "ending read '" << filename << "'" << LL_ENDL; + if (!didFileRead) { if(is_new_filename) |