зеркало из 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);
|
nsresult rv = SetupByteRangeRequest(partialLen);
|
||||||
if (NS_FAILED(rv)) {
|
if (NS_FAILED(rv)) {
|
||||||
// Make the request unconditional again.
|
// Make the request unconditional again.
|
||||||
mRequestHead.ClearHeader(nsHttp::Range);
|
UntieByteRangeRequest();
|
||||||
mRequestHead.ClearHeader(nsHttp::If_Range);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return rv;
|
return rv;
|
||||||
|
@ -2251,6 +2250,13 @@ nsHttpChannel::SetupByteRangeRequest(int64_t partialLen)
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
nsHttpChannel::UntieByteRangeRequest()
|
||||||
|
{
|
||||||
|
mRequestHead.ClearHeader(nsHttp::Range);
|
||||||
|
mRequestHead.ClearHeader(nsHttp::If_Range);
|
||||||
|
}
|
||||||
|
|
||||||
nsresult
|
nsresult
|
||||||
nsHttpChannel::ProcessPartialContent()
|
nsHttpChannel::ProcessPartialContent()
|
||||||
{
|
{
|
||||||
|
@ -2965,9 +2971,16 @@ nsHttpChannel::OnCacheEntryCheck(nsICacheEntry* entry, nsIApplicationCache* appC
|
||||||
mCachedContentIsPartial = NS_SUCCEEDED(rv) && mIsPartialRequest;
|
mCachedContentIsPartial = NS_SUCCEEDED(rv) && mIsPartialRequest;
|
||||||
if (mCachedContentIsPartial) {
|
if (mCachedContentIsPartial) {
|
||||||
rv = OpenCacheInputStream(entry, false, !!appCache);
|
rv = OpenCacheInputStream(entry, false, !!appCache);
|
||||||
|
if (NS_FAILED(rv)) {
|
||||||
|
UntieByteRangeRequest();
|
||||||
|
return rv;
|
||||||
|
}
|
||||||
|
|
||||||
*aResult = ENTRY_NEEDS_REVALIDATION;
|
*aResult = ENTRY_NEEDS_REVALIDATION;
|
||||||
return rv;
|
return NS_OK;
|
||||||
} else if (size == 0 && mCacheOnlyMetadata) {
|
}
|
||||||
|
|
||||||
|
if (size == 0 && mCacheOnlyMetadata) {
|
||||||
// Don't break cache entry load when the entry's data size
|
// Don't break cache entry load when the entry's data size
|
||||||
// is 0 and mCacheOnlyMetadata flag is set. In that case we
|
// is 0 and mCacheOnlyMetadata flag is set. In that case we
|
||||||
// want to proceed since the LOAD_ONLY_IF_MODIFIED flag is
|
// want to proceed since the LOAD_ONLY_IF_MODIFIED flag is
|
||||||
|
|
|
@ -367,6 +367,7 @@ private:
|
||||||
nsresult MaybeSetupByteRangeRequest(int64_t partialLen, int64_t contentLength,
|
nsresult MaybeSetupByteRangeRequest(int64_t partialLen, int64_t contentLength,
|
||||||
bool ignoreMissingPartialLen = false);
|
bool ignoreMissingPartialLen = false);
|
||||||
nsresult SetupByteRangeRequest(int64_t partialLen);
|
nsresult SetupByteRangeRequest(int64_t partialLen);
|
||||||
|
void UntieByteRangeRequest();
|
||||||
nsresult OpenCacheInputStream(nsICacheEntry* cacheEntry, bool startBuffering,
|
nsresult OpenCacheInputStream(nsICacheEntry* cacheEntry, bool startBuffering,
|
||||||
bool checkingAppCacheEntry);
|
bool checkingAppCacheEntry);
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче