History

Case 19754 - Remove logging URLs and related file locations.

The goal is to strip out data that can be used by untoward users in copying models, avatars, etc.

Roxanne Skelly committed 8 years ago

Commit cef70001 parent e80468e36 files · +84 −201Browse files

Showing the changes to libraries/script-engine/src/ScriptCache.cpp (1 of 36 files). Show all

Unified · Split

libraries/script-engine/src/ScriptCache.cpp+5−13
@@ -37,9 +37,6 @@ ScriptCache::ScriptCache(QObject* parent) { · 36 unmodified lines
37 37
38void ScriptCache::clearCache() {38void ScriptCache::clearCache() {
39 Lock lock(_containerLock);39 Lock lock(_containerLock);
40 foreach(auto& url, _scriptCache.keys()) {
41 qCDebug(scriptengine) << "clearing cache: " << url;
42 }
43 _scriptCache.clear();40 _scriptCache.clear();
44}41}
45 42
@@ -48,7 +45,6 @@ void ScriptCache::clearATPScriptsFromCache() { · 2 unmodified lines
48 qCDebug(scriptengine) << "Clearing ATP scripts from ScriptCache";45 qCDebug(scriptengine) << "Clearing ATP scripts from ScriptCache";
49 for (auto it = _scriptCache.begin(); it != _scriptCache.end();) {46 for (auto it = _scriptCache.begin(); it != _scriptCache.end();) {
50 if (it.key().scheme() == "atp") {47 if (it.key().scheme() == "atp") {
51 qCDebug(scriptengine) << "Removing: " << it.key();
52 it = _scriptCache.erase(it);48 it = _scriptCache.erase(it);
53 } else {49 } else {
54 ++it;50 ++it;
@@ -60,7 +56,6 @@ void ScriptCache::deleteScript(const QUrl& unnormalizedURL) { · 5 unmodified lines
60 QUrl url = DependencyManager::get<ResourceManager>()->normalizeURL(unnormalizedURL);56 QUrl url = DependencyManager::get<ResourceManager>()->normalizeURL(unnormalizedURL);
61 Lock lock(_containerLock);57 Lock lock(_containerLock);
62 if (_scriptCache.contains(url)) {58 if (_scriptCache.contains(url)) {
63 qCDebug(scriptengine) << "Delete script from cache:" << url.toString();
64 _scriptCache.remove(url);59 _scriptCache.remove(url);
65 }60 }
66}61}
@@ -146,7 +141,6 @@ void ScriptCache::scriptContentAvailable(int maxRetries) { · 79 unmodified lines
146 _activeScriptRequests.remove(url);141 _activeScriptRequests.remove(url);
147 142
148 _scriptCache[url] = scriptContent = req->getData();143 _scriptCache[url] = scriptContent = req->getData();
149 qCDebug(scriptengine) << "Done downloading script at:" << url.toString();
150 } else {144 } else {
151 auto result = req->getResult();145 auto result = req->getResult();
152 bool irrecoverable =146 bool irrecoverable =
@@ -160,12 +154,12 @@ void ScriptCache::scriptContentAvailable(int maxRetries) { · 7 unmodified lines
160 154
161 int timeout = exp(scriptRequest.numRetries) * ScriptRequest::START_DELAY_BETWEEN_RETRIES;155 int timeout = exp(scriptRequest.numRetries) * ScriptRequest::START_DELAY_BETWEEN_RETRIES;
162 int attempt = scriptRequest.numRetries;156 int attempt = scriptRequest.numRetries;
163 qCDebug(scriptengine) << QString("Script request failed [%1]: %2 (will retry %3 more times; attempt #%4 in %5ms...)")157 qCDebug(scriptengine) << QString("Script request failed [%1]: (will retry %2 more times; attempt #%3 in %4ms...)")
164 .arg(status).arg(url.toString()).arg(maxRetries - attempt + 1).arg(attempt).arg(timeout);158 .arg(status).arg(maxRetries - attempt + 1).arg(attempt).arg(timeout);
165 159
166 QTimer::singleShot(timeout, this, [this, url, attempt, maxRetries]() {160 QTimer::singleShot(timeout, this, [this, url, attempt, maxRetries]() {
167 qCDebug(scriptengine) << QString("Retrying script request [%1 / %2]: %3")161 qCDebug(scriptengine) << QString("Retrying script request [%1 / %2]")
168 .arg(attempt).arg(maxRetries).arg(url.toString());162 .arg(attempt).arg(maxRetries);
169 163
170 auto request = DependencyManager::get<ResourceManager>()->createResourceRequest(164 auto request = DependencyManager::get<ResourceManager>()->createResourceRequest(
171 nullptr, url, true, -1, "ScriptCache::scriptContentAvailable");165 nullptr, url, true, -1, "ScriptCache::scriptContentAvailable");
@@ -186,12 +180,10 @@ void ScriptCache::scriptContentAvailable(int maxRetries) { · 14 unmodified lines
186 scriptContent = _scriptCache[url];180 scriptContent = _scriptCache[url];
187 }181 }
188 _activeScriptRequests.remove(url);182 _activeScriptRequests.remove(url);
189 qCWarning(scriptengine) << "Error loading script from URL " << url << "(" << status <<")";183 qCWarning(scriptengine) << "Error loading script from URL (" << status <<")";
190 184
191 }185 }
192 }186 }
193 } else {
194 qCWarning(scriptengine) << "Warning: scriptContentAvailable for inactive url: " << url;
195 }187 }
196 }188 }
197 189