Fix for bug 38244 - modified files cached incorrectly,r=ruslan@netscape.com

This commit is contained in:
neeti%netscape.com 2000-07-21 04:33:26 +00:00
parent bef8a9c0ab
commit c5cd14f561
3 changed files with 29 additions and 0 deletions

View File

@ -959,6 +959,17 @@ nsCachedNetData::SetStoredContentLength(PRUint32 aStoredContentLength)
return mRecord->SetStoredContentLength(aStoredContentLength);
}
NS_IMETHODIMP
nsCachedNetData::GetLogicalLength(PRUint32 *aLogicalLength)
{
CHECK_AVAILABILITY();
if (mLogicalLength)
*aLogicalLength = mLogicalLength;
else
*aLogicalLength = 0;
return NS_OK;
}
NS_IMETHODIMP
nsCachedNetData::GetSecurityInfo (nsISupports ** o_SecurityInfo)
{

View File

@ -178,6 +178,12 @@ interface nsICachedNetData : nsISupports
*/
attribute PRUint32 storedContentLength;
/**
* Length of stored content, which may be less than storage consumed if
* compression is used
*/
readonly attribute PRUint32 logicalLength;
/**
* Opaque security info associated with the cache entry; it can't be serialized
* to disk, so it'll only make sense with memory cache

View File

@ -1764,6 +1764,18 @@ nsresult nsHTTPChannel::ResponseCompleted(
}
}
PRUint32 contentLength;
PRUint32 logicalLength;
mCacheEntry->GetLogicalLength(&logicalLength);
if (logicalLength)
{
mCacheEntry->GetStoredContentLength(&contentLength);
if (contentLength > logicalLength)
{
mCacheEntry->SetStoredContentLength(logicalLength);
}
}
//
// After the consumer has been notified, remove the channel from its
// load group... This will trigger an OnStopRequest from the load group.