зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1117763 - Remove range request headers on cache entry open failure. r=michal
This commit is contained in:
Родитель
cc4a1f03e4
Коммит
648b93198b
|
@ -2216,8 +2216,7 @@ nsHttpChannel::MaybeSetupByteRangeRequest(int64_t partialLen, int64_t contentLen
|
|||
nsresult rv = SetupByteRangeRequest(partialLen);
|
||||
if (NS_FAILED(rv)) {
|
||||
// Make the request unconditional again.
|
||||
mRequestHead.ClearHeader(nsHttp::Range);
|
||||
mRequestHead.ClearHeader(nsHttp::If_Range);
|
||||
UntieByteRangeRequest();
|
||||
}
|
||||
|
||||
return rv;
|
||||
|
@ -2251,6 +2250,13 @@ nsHttpChannel::SetupByteRangeRequest(int64_t partialLen)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
void
|
||||
nsHttpChannel::UntieByteRangeRequest()
|
||||
{
|
||||
mRequestHead.ClearHeader(nsHttp::Range);
|
||||
mRequestHead.ClearHeader(nsHttp::If_Range);
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsHttpChannel::ProcessPartialContent()
|
||||
{
|
||||
|
@ -2965,9 +2971,16 @@ nsHttpChannel::OnCacheEntryCheck(nsICacheEntry* entry, nsIApplicationCache* appC
|
|||
mCachedContentIsPartial = NS_SUCCEEDED(rv) && mIsPartialRequest;
|
||||
if (mCachedContentIsPartial) {
|
||||
rv = OpenCacheInputStream(entry, false, !!appCache);
|
||||
if (NS_FAILED(rv)) {
|
||||
UntieByteRangeRequest();
|
||||
return rv;
|
||||
}
|
||||
|
||||
*aResult = ENTRY_NEEDS_REVALIDATION;
|
||||
return rv;
|
||||
} else if (size == 0 && mCacheOnlyMetadata) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
if (size == 0 && mCacheOnlyMetadata) {
|
||||
// Don't break cache entry load when the entry's data size
|
||||
// is 0 and mCacheOnlyMetadata flag is set. In that case we
|
||||
// want to proceed since the LOAD_ONLY_IF_MODIFIED flag is
|
||||
|
|
|
@ -367,6 +367,7 @@ private:
|
|||
nsresult MaybeSetupByteRangeRequest(int64_t partialLen, int64_t contentLength,
|
||||
bool ignoreMissingPartialLen = false);
|
||||
nsresult SetupByteRangeRequest(int64_t partialLen);
|
||||
void UntieByteRangeRequest();
|
||||
nsresult OpenCacheInputStream(nsICacheEntry* cacheEntry, bool startBuffering,
|
||||
bool checkingAppCacheEntry);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче