mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-14 02:31:59 +00:00
Fix for bug 38244 - modified files cached incorrectly,r=ruslan@netscape.com
This commit is contained in:
parent
bef8a9c0ab
commit
c5cd14f561
11
netwerk/cache/mgr/nsCachedNetData.cpp
vendored
11
netwerk/cache/mgr/nsCachedNetData.cpp
vendored
@ -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)
|
||||
{
|
||||
|
6
netwerk/cache/public/nsICachedNetData.idl
vendored
6
netwerk/cache/public/nsICachedNetData.idl
vendored
@ -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
|
||||
|
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user