From 21c1907240d96cd3946f653d07f1ca74801f5b09 Mon Sep 17 00:00:00 2001 From: Jim Mathies Date: Wed, 13 Apr 2011 13:34:14 -0500 Subject: [PATCH] Bug 644431 - Fix for Adobe PDF Files Larger than 5 MB Won't Load in browser. r=bz, a2.0=dveditz --- netwerk/cache/nsCacheService.cpp | 1 + netwerk/cache/nsDiskCacheDevice.cpp | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/netwerk/cache/nsCacheService.cpp b/netwerk/cache/nsCacheService.cpp index ed14309e8c372..b63f9ff8ce131 100644 --- a/netwerk/cache/nsCacheService.cpp +++ b/netwerk/cache/nsCacheService.cpp @@ -1849,6 +1849,7 @@ nsCacheService::EnsureEntryHasDevice(nsCacheEntry * entry) if (mDiskDevice) { // Bypass the cache if Content-Length says the entry will be too big if (predictedDataSize != -1 && + entry->StoragePolicy() != nsICache::STORE_ON_DISK_AS_FILE && mDiskDevice->EntryIsTooBig(predictedDataSize)) { nsresult rv = nsCacheService::DoomEntry(entry); NS_ASSERTION(NS_SUCCEEDED(rv),"DoomEntry() failed."); diff --git a/netwerk/cache/nsDiskCacheDevice.cpp b/netwerk/cache/nsDiskCacheDevice.cpp index e077812200cf1..b74dd20becd95 100644 --- a/netwerk/cache/nsDiskCacheDevice.cpp +++ b/netwerk/cache/nsDiskCacheDevice.cpp @@ -784,8 +784,10 @@ nsDiskCacheDevice::OnDataSizeChange(nsCacheEntry * entry, PRInt32 deltaSize) PRUint32 newSizeK = ((newSize + 0x3FF) >> 10); // If the new size is larger than max. file size or larger than - // 1/8 the cache capacity (which is in KiB's), doom the entry and abort - if (EntryIsTooBig(newSize)) { + // 1/8 the cache capacity (which is in KiB's), and the entry has + // not been marked for file storage, doom the entry and abort. + if (EntryIsTooBig(newSize) && + entry->StoragePolicy() != nsICache::STORE_ON_DISK_AS_FILE) { #ifdef DEBUG nsresult rv = #endif