Closed Bug 426273 Opened 17 years ago Closed 17 years ago

[FIX]"Content Encoding Error" page displayed when redownloading a previously cancelled .tar.gz file

Categories

(Core :: Networking: Cache, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: bent.mozilla, Assigned: bzbarsky)

References

Details

Attachments

(2 files)

STR: 1. Navigate to http://www.w3.org/Graphics/SVG/Test/ 2. Click on the first bulleted link, "W3C SVG 1.2 Tiny Test Suite" (http://www.w3.org/Graphics/SVG/Test/20070907/W3C_SVG_12_TinyTestSuite.tar.gz) 3. Click cancel on the save dialog. 4. Click the link again. 5. "Content Encoding Error" page displayed. To fix things up all you have to do is clear your cache. Note that if you don't cancel but instead continue with the download you will be able to continue retrying successfully forever. It's that first cancel that seems to break everything. Firefox 2 has worse behavior - it doesn't display the error page but just sits there looking dumb.
Flags: blocking1.9?
Minusing based on not a regressin; should fix it in a point release..
Flags: wanted1.9.0.x+
Flags: blocking1.9?
Flags: blocking1.9-
I cannot see the error message with Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9pre) Gecko/2008051306 Minefield/3.0pre ID:2008051306 Bent, is this still valid for you?
Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9pre) Gecko/2008051404 Minefield/3.0pre Yes, happens exactly as described in comment 0.
Ok, I wasn't probably seeing this because I was behind a proxy. Now I'm able to reproduce with Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9pre) Gecko/2008050920 Minefield/3.0pre Will a HTTP log help here?
OS: Mac OS X → All
Hardware: PC → All
Possibly, yes.
Attached file http log
I'm using session restore and I'm able to reproduce this issue when the gz file is set inside the location bar when closing Firefox. After a restart I get directly the Content Encoding Error. I hope it helps.
Presumably this part in ProcessPartialContent is responsible: 1202 // Check if the content-encoding we now got is different from the one we 1203 // got before 1204 if (PL_strcasecmp(mResponseHead->PeekHeader(nsHttp::Content_Encoding), 1205 mCachedResponseHead->PeekHeader(nsHttp::Content_Encoding)) 1206 != 0) { 1207 Cancel(NS_ERROR_INVALID_CONTENT_ENCODING); 1208 return CallOnStartRequest(); 1209 } 1210 Someone want to check what those two values are in this case? Note that the sever 206 response _does_ have "Content-Encoding: gzip" as far as I can tell, so presumably the issue is that our cached stuff doesn't?
Looks like mCachedResponseHead has a null pointer for that header, while mResponseHead points to the string "gzip".
Oh, of course. This is the apache bug where they send 3804[728640]: Content-Type: application/gzip; qs=0.001 3804[728640]: Content-Encoding: gzip and we clear the content-encoding to work around it. We just need to do the clearing before we do this check in ProcessPartialContent, I bet. Ben, want to take a look into doing this?
Attached patch FixSplinter Review
This fixes the bug. The only issue is that the test fails every second run with this assertion: ###!!! ASSERTION: storage allocated for zero data size: '!mBinding->mRecord.DataLocationInitialized()', file /Users/bzbarsky/mozilla/debug/mozilla/netwerk/cache/src/nsDiskCacheStreams.cpp, line 372 in a debug build. Any idea how I can avoid that?
Assignee: nobody → bzbarsky
Status: NEW → ASSIGNED
Attachment #331386 - Flags: superreview?(cbiesinger)
Attachment #331386 - Flags: review?(cbiesinger)
Summary: "Content Encoding Error" page displayed when redownloading a previously cancelled .tar.gz file → [FIX]"Content Encoding Error" page displayed when redownloading a previously cancelled .tar.gz file
Comment on attachment 331386 [details] [diff] [review] Fix +++ b/netwerk/test/unit/test_gzipped_206.js +const responseBody = ... can you break this up into multiple lines, to stay below 80 columns? + if (doRangeResponse) { inconsistent indentation in the then and else branches of this if + .cancel(Components.results.NS_ERROR_NO_INTERFACE); hm, interesting choice of error code. considering that other code uses this too, maybe BINDING_ABORTED would be better?
Attachment #331386 - Flags: superreview?(cbiesinger)
Attachment #331386 - Flags: superreview+
Attachment #331386 - Flags: review?(cbiesinger)
Attachment #331386 - Flags: review+
I could do BINDING_ABORTED. I just wanted an easy hassle-free error code I knew was in Components.results. The question from the end of comment 10 remains.... Can't really check the test in until that's resolved. :(
Filed bug 448712 on the issue from comment 10.
Depends on: 448712
Pushed changeset 1238046c4cce.
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Flags: wanted1.9.0.x+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: