Bug 1475701 - Save Page As doesn't begin MP3 download while tab is open, r=valentin
☠☠ backed out by 15b0846ed2fc ☠ ☠
authorMichal Novotny <michal.novotny@gmail.com>
Thu, 26 Jul 2018 14:54:00 +0300
changeset 823516 3ff805a9631e4248d0b720c25e9277a0fd7679d4
parent 823464 ad1674e9152da31151ab9f9f099f83ca4ff2d832
child 823517 f13608115d2dbfedf82f085fba42ccaff3ef5526
push id117712
push userrwood@mozilla.com
push dateFri, 27 Jul 2018 15:10:54 +0000
reviewersvalentin
bugs1475701
milestone63.0a1
Bug 1475701 - Save Page As doesn't begin MP3 download while tab is open, r=valentin We need to close the cache entry if opening output stream for writing/appending data failed, so the entry isn't blocked for other requests.
netwerk/protocol/http/nsHttpChannel.cpp
--- a/netwerk/protocol/http/nsHttpChannel.cpp
+++ b/netwerk/protocol/http/nsHttpChannel.cpp
@@ -5416,16 +5416,17 @@ nsHttpChannel::InstallCacheListener(int6
         LOG(("  entry doomed, not writing it [channel=%p]", this));
         // Entry is already doomed.
         // This may happen when expiration time is set to past and the entry
         // has been removed by the background eviction logic.
         return NS_OK;
     }
     if (rv == NS_ERROR_FILE_TOO_BIG) {
         LOG(("  entry would exceed max allowed size, not writing it [channel=%p]", this));
+        CloseCacheEntry(false);
         return NS_OK;
     }
     if (NS_FAILED(rv)) return rv;
 
     if (mCacheOnlyMetadata) {
         LOG(("Not storing content, cacheOnlyMetadata set"));
         // We must open and then close the output stream of the cache entry.
         // This way we indicate the content has been written (despite with zero