Bug 771832 - File not found error for HTTP URL, can be fixed by a forced reload, r=hurley
authorMichal Novotny <michal.novotny@gmail.com>
Wed, 17 Oct 2012 13:59:51 +0200
changeset 110660 cc7c7fdbfd53e3e48ade26b2cf066614ddce57ef
parent 110659 04c1835aa9c7cf1d3462568cfd61c8e7d5754957
child 110661 353c63026073619fd1fc624c033115669c57c0a5
push id93
push usernmatsakis@mozilla.com
push dateWed, 31 Oct 2012 21:26:57 +0000
reviewershurley
bugs771832
milestone19.0a1
Bug 771832 - File not found error for HTTP URL, can be fixed by a forced reload, r=hurley
netwerk/cache/nsDiskCacheStreams.cpp
--- a/netwerk/cache/nsDiskCacheStreams.cpp
+++ b/netwerk/cache/nsDiskCacheStreams.cpp
@@ -446,16 +446,20 @@ nsDiskCacheStreamIO::Flush()
         // delete existing storage
         nsDiskCacheRecord * record = &mBinding->mRecord;
         if (record->DataLocationInitialized()) {
             rv = cacheMap->DeleteStorage(record, nsDiskCache::kData);
             if (NS_FAILED(rv)) {
                 NS_WARNING("cacheMap->DeleteStorage() failed.");
                 return rv;
             }
+            if (mFD) {
+                PR_Close(mFD);
+                mFD = nullptr;
+            }
         }
 
         // flush buffer to block files
         written = true;
         if (mStreamEnd > 0) {
             rv = cacheMap->WriteDataCacheBlocks(mBinding, mBuffer, mBufEnd);
             if (NS_FAILED(rv)) {
                 NS_WARNING("WriteDataCacheBlocks() failed.");