From 492efd6678f2f9db8d66b0bde5136bc1e5740cbb Mon Sep 17 00:00:00 2001 From: Dmitry Zaporozhan Date: Fri, 16 Apr 2010 09:25:40 +0300 Subject: Fixed EXT-6423(normal) - Windows viewer spends a minute clearing cache when there is no cache Problem description: The code that purges cache does not expect any folders there, error occurs when it tries to delete a file, which is actually a folder. To handle an error the code sleeps for 1 second and tries to delete the file 4 more times(sleeping for 1 second after each try). Fix info: Using LLFile::isDir to skip directories and only delete files. Reviewed by Vadim Savchuk - https://codereview.productengine.com/secondlife/r/239/ --HG-- branch : product-engine --- indra/llvfs/lldir.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'indra/llvfs/lldir.cpp') diff --git a/indra/llvfs/lldir.cpp b/indra/llvfs/lldir.cpp index da4abde451..29b6f490c8 100644 --- a/indra/llvfs/lldir.cpp +++ b/indra/llvfs/lldir.cpp @@ -91,15 +91,16 @@ S32 LLDir::deleteFilesInDir(const std::string &dirname, const std::string &mask) S32 result; while (getNextFileInDir(dirname, mask, filename, FALSE)) { - if ((filename == ".") || (filename == "..")) + fullpath = dirname; + fullpath += getDirDelimiter(); + fullpath += filename; + + if(LLFile::isdir(fullpath)) { // skipping directory traversal filenames count++; continue; } - fullpath = dirname; - fullpath += getDirDelimiter(); - fullpath += filename; S32 retry_count = 0; while (retry_count < 5) -- cgit v1.2.3