Bug 771832 - File not found error for HTTP URL, can be fixed by a forced reload, r=hurley, a=lsblakk
authorMichal Novotny <michal.novotny@gmail.com>
Wed, 17 Oct 2012 13:59:51 +0200
changeset 109634 b141b78a39acd3499718c1c436d103f765abed1f
parent 109633 3d5ad9d84bf3f6d994b35c825a98a19ab6a80a61
child 109635 e3d6c1a5fa41f480cbdae101318ddfe978f8c889
push id1585
push userryanvm@gmail.com
push dateTue, 23 Oct 2012 03:49:51 +0000
treeherdermozilla-beta@121213ddf98b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewershurley, lsblakk
bugs771832
milestone17.0
Bug 771832 - File not found error for HTTP URL, can be fixed by a forced reload, r=hurley, a=lsblakk
netwerk/cache/nsDiskCacheStreams.cpp
--- a/netwerk/cache/nsDiskCacheStreams.cpp
+++ b/netwerk/cache/nsDiskCacheStreams.cpp
@@ -526,16 +526,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.");