37071 Crash while downloading anything

This commit is contained in:
davidm%netscape.com 2000-05-07 05:38:02 +00:00
Родитель 73b7310c91
Коммит 43963449c6
2 изменённых файлов: 6 добавлений и 14 удалений

15
netwerk/cache/filecache/nsNetDiskCache.cpp поставляемый
Просмотреть файл

@ -472,7 +472,7 @@ nsNetDiskCache::GetCachedNetDataByID(PRInt32 RecordID, nsINetDataCacheRecord **_
return rv;
}
NS_ERROR("Error: RecordID not in DB\n");
NS_WARNING("Error: RecordID not in DB\n");
DBRecovery();
return rv;
}
@ -751,18 +751,9 @@ nsNetDiskCache::DBRecovery(void)
// False since we want to delete a file rather than recursively delete a directory
mDBFile->Delete(PR_FALSE) ;
// make sure it's not there any more
// DJM shouldn't we just check the return value?
rv = mDBFile->Delete(PR_FALSE) ;
if (NS_FAILED ( rv ) ) return rv;
PRBool exists =PR_FALSE;
mDBFile->Exists( &exists );
if(exists) {
NS_ERROR("can't remove old db.") ;
return NS_ERROR_FAILURE ;
}
// reinitilize DB
return InitDB() ;

5
netwerk/cache/mgr/nsCachedNetData.cpp поставляемый
Просмотреть файл

@ -1029,8 +1029,9 @@ nsresult
nsCachedNetData::Evict(PRUint32 aTruncatedContentLength)
{
nsCOMPtr<nsINetDataCacheRecord> record;
GetRecord(getter_AddRefs(record));
nsresult rv = GetRecord(getter_AddRefs(record));
if ( NS_FAILED( rv ) ) return rv;
if ( record.get() == NULL ) return NS_ERROR_FAILURE;
// Tell observers about the eviction, so that they can release their
// references to this cache object.
Notify(nsIStreamAsFileObserver::REQUEST_DELETION, NS_OK);