Closed Bug 386233 Opened 17 years ago Closed 17 years ago

Content sniffers not always run depending on cache state

Categories

(Core :: Networking: HTTP, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: bent.mozilla, Assigned: bent.mozilla)

Details

Attachments

(1 file, 1 obsolete file)

I just ran into this problem and biesi helped me (a lot!) track it down. Here's the scenario: I have a content sniffer and a URI content listener component. I'm using the sniffer to mark certain URIs with an application-specific MIME type. Then I'm using the URI content listener to abort the load and pass the URI off to another component. This works really well the first time I launch one of the URIs that I care about. It doesn't work the second time I launch the same URI due to a caching issue. It seems that when I abort the load the first time a partial cache entry is created with no data in it (sometimes? always? seems like always to me). Then, in nsHttpChannel::CallOnStartRequest, PeekStream is called to give data to the content sniffers with the cache pump rather than the transaction pump. This makes sense, but it should fall back to the transaction pump if the cache pump has no data in it. My workaround was to doom the cache entry for the cancelled load.
Attached patch Patch (obsolete) (deleted) — Splinter Review
This patch is how I'd like to fix the problem. I'm respinning a XULRunner now to test it, but it at least compiles. It will take me a few hours to get it ready to go, so biesi does this look ok?
Assignee: nobody → bent.mozilla
Status: NEW → ASSIGNED
Attachment #270220 - Flags: review?(cbiesinger)
Attached patch Patch (deleted) — Splinter Review
Better patch, checks to make sure mTransactionPump is real as well.
Attachment #270220 - Attachment is obsolete: true
Attachment #270221 - Flags: review?(cbiesinger)
Attachment #270220 - Flags: review?(cbiesinger)
Comment on attachment 270221 [details] [diff] [review] Patch looks good. make sure to test this before checking in :-)
Attachment #270221 - Flags: review?(cbiesinger) → review+
Comment on attachment 270221 [details] [diff] [review] Patch This passes all my tests :)
Attachment #270221 - Flags: superreview?(cbiesinger)
Attachment #270221 - Flags: superreview?(cbiesinger) → superreview+
Fixed on trunk.
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
I wonder whether we can add a test for this...
Flags: in-testsuite?
Could this have caused bug 386712?
(In reply to comment #6) > I wonder whether we can add a test for this... biesi mentioned tests, seemed to want to wait until profile support (for caching) was added to xpcshell. (In reply to comment #7) > Could this have caused bug 386712? Don't think so.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: