mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1119406 - HTTP cache v2: Doom cache entry when writing of metadata fails, r=honzab
This commit is contained in:
parent
374e2ca9d1
commit
cdc4849d47
@ -612,8 +612,9 @@ CacheFile::OnMetadataWritten(nsresult aResult)
|
||||
MOZ_ASSERT(!mMemoryOnly);
|
||||
MOZ_ASSERT(!mOpeningFile);
|
||||
|
||||
if (NS_FAILED(aResult)) {
|
||||
if (NS_WARN_IF(NS_FAILED(aResult))) {
|
||||
// TODO close streams with an error ???
|
||||
SetError(aResult);
|
||||
}
|
||||
|
||||
if (mOutput || mInputs.Length() || mChunks.Count())
|
||||
|
@ -706,6 +706,10 @@ public:
|
||||
} else {
|
||||
rv = CacheFileIOManager::gInstance->WriteInternal(
|
||||
mHandle, mOffset, mBuf, mCount, mValidate);
|
||||
if (NS_FAILED(rv) && !mCallback) {
|
||||
// No listener is going to handle the error, doom the file
|
||||
CacheFileIOManager::gInstance->DoomFileInternal(mHandle);
|
||||
}
|
||||
}
|
||||
MOZ_EVENT_TRACER_DONE(static_cast<nsIRunnable*>(this), "net::cache::write-background");
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user