mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-12 04:45:45 +00:00
Bug 443067 - Disk Cache overflow when downloading large files. r=bz
--HG-- extra : rebase_source : 23492fb28c073b676d193703bb9bb6a2976a462a
This commit is contained in:
parent
ee6e9661b7
commit
009289b688
4
netwerk/cache/nsDiskCacheDevice.cpp
vendored
4
netwerk/cache/nsDiskCacheDevice.cpp
vendored
@ -784,8 +784,8 @@ nsDiskCacheDevice::OnDataSizeChange(nsCacheEntry * entry, PRInt32 deltaSize)
|
||||
|
||||
PRUint32 sizeK = ((entry->DataSize() + 0x03FF) >> 10); // round up to next 1k
|
||||
|
||||
NS_ASSERTION(sizeK < USHRT_MAX, "data size out of range");
|
||||
NS_ASSERTION(newSizeK < USHRT_MAX, "data size out of range");
|
||||
NS_ASSERTION(sizeK <= USHRT_MAX, "data size out of range");
|
||||
NS_ASSERTION(newSizeK <= USHRT_MAX, "data size out of range");
|
||||
|
||||
// pre-evict entries to make space for new data
|
||||
PRUint32 targetCapacity = mCacheCapacity > (newSizeK - sizeK)
|
||||
|
4
netwerk/cache/nsDiskCacheMap.h
vendored
4
netwerk/cache/nsDiskCacheMap.h
vendored
@ -90,7 +90,7 @@ struct nsDiskCacheEntry;
|
||||
#define kMinRecordCount 512
|
||||
|
||||
#define kSeparateFile 0
|
||||
#define kMaxDataFileSize 0x4000000 // 64 MiB
|
||||
#define kMaxDataFileSize 0x3FFFC00 // 65535 KiB (see bug #443067)
|
||||
#define kBuckets (1 << 5) // must be a power of 2!
|
||||
|
||||
class nsDiskCacheRecord {
|
||||
@ -334,7 +334,7 @@ class nsDiskCacheRecordVisitor {
|
||||
|
||||
struct nsDiskCacheHeader {
|
||||
PRUint32 mVersion; // cache version.
|
||||
PRUint32 mDataSize; // size of cache in units of 256bytes.
|
||||
PRUint32 mDataSize; // size of cache in units of 1024bytes.
|
||||
PRInt32 mEntryCount; // number of entries stored in cache.
|
||||
PRUint32 mIsDirty; // dirty flag.
|
||||
PRInt32 mRecordCount; // Number of records
|
||||
|
Loading…
Reference in New Issue
Block a user