This fixes two small problems that may cause pages being partially loaded. 82720. The first problem addresses new cache entries being created when access to the entry is readonly. The second fix was to a badly placed assertion.

Patch by gordon, r=bbaetz, sr=dougt.
This commit is contained in:
bbaetz%cs.mcgill.ca 2001-07-18 23:37:17 +00:00
Родитель 60f62658b5
Коммит 2b0a7464d0
2 изменённых файлов: 9 добавлений и 8 удалений

11
netwerk/cache/src/nsCacheService.cpp поставляемый
Просмотреть файл

@ -833,11 +833,6 @@ nsCacheService::ActivateEntry(nsCacheRequest * request,
} else {
++mCacheMisses;
}
if (!entry && !(request->AccessRequested() & nsICache::ACCESS_WRITE)) {
// this is a READ-ONLY request
rv = NS_ERROR_CACHE_KEY_NOT_FOUND;
goto error;
}
if (entry &&
((request->AccessRequested() == nsICache::ACCESS_WRITE) ||
@ -854,6 +849,12 @@ nsCacheService::ActivateEntry(nsCacheRequest * request,
}
if (!entry) {
if (! (request->AccessRequested() & nsICache::ACCESS_WRITE)) {
// this is a READ-ONLY request
rv = NS_ERROR_CACHE_KEY_NOT_FOUND;
goto error;
}
entry = new nsCacheEntry(request->mKey,
request->IsStreamBased(),
request->StoragePolicy());

6
netwerk/cache/src/nsMemoryCacheDevice.cpp поставляемый
Просмотреть файл

@ -164,10 +164,10 @@ nsMemoryCacheDevice::DeactivateEntry(nsCacheEntry * entry)
nsresult
nsMemoryCacheDevice::BindEntry(nsCacheEntry * entry)
{
NS_ASSERTION(PR_CLIST_IS_EMPTY(entry),"entry is already on a list!");
if (!entry->IsDoomed()) {
// append entry to the eviction list
NS_ASSERTION(PR_CLIST_IS_EMPTY(entry),"entry is already on a list!");
// append entry to the eviction list
PR_APPEND_LINK(entry, &mEvictionList[EvictionList(entry, 0)]);
// add entry to hashtable of mem cache entries