From 66bc5107863e8226e91818cd9d3c075d0514dbe5 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Thu, 2 Apr 2015 21:43:34 -0400 Subject: detect xml errors in parsing xml files and remove those files --- indra/newview/llnotificationstorage.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'indra/newview/llnotificationstorage.cpp') 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 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) -- cgit v1.2.3