зеркало из https://github.com/mozilla/pjs.git
Bug 725597 - SafeBrowsing fails to update persistent PrefixSet on Windows. r=dcamp
This commit is contained in:
Родитель
05b6e6955a
Коммит
a4b0e83355
|
@ -587,7 +587,8 @@ Classifier::ApplyTableUpdates(nsTArray<TableUpdate*>* aUpdates,
|
|||
#if defined(DEBUG) && defined(PR_LOGGING)
|
||||
prefixSet->Dump();
|
||||
#endif
|
||||
prefixSet->WriteFile();
|
||||
rv = prefixSet->WriteFile();
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
// This will drop all the temporary storage used during the update.
|
||||
rv = store->FinishUpdate();
|
||||
|
|
|
@ -259,6 +259,13 @@ LookupCache::WriteFile()
|
|||
rv = storeFile->AppendNative(mTableName + NS_LITERAL_CSTRING(CACHE_SUFFIX));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
// Need to close the inputstream here *before* rewriting its file.
|
||||
// Windows will fail if we don't.
|
||||
if (mInputStream) {
|
||||
rv = mInputStream->Close();
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIOutputStream> out;
|
||||
rv = NS_NewSafeLocalFileOutputStream(getter_AddRefs(out), storeFile,
|
||||
PR_WRONLY | PR_TRUNCATE | PR_CREATE_FILE);
|
||||
|
|
|
@ -36,8 +36,8 @@ function delFile(name) {
|
|||
}
|
||||
|
||||
function cleanUp() {
|
||||
delFile("classifier.hashkey");
|
||||
delFile("urlclassifier3.sqlite");
|
||||
delFile("safebrowsing/classifier.hashkey");
|
||||
delFile("safebrowsing/test-phish-simple.sbstore");
|
||||
delFile("safebrowsing/test-malware-simple.sbstore");
|
||||
delFile("safebrowsing/test-phish-simple.cache");
|
||||
|
|
Загрузка…
Ссылка в новой задаче