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)
Tracking
()
RESOLVED
FIXED
People
(Reporter: bent.mozilla, Assigned: bent.mozilla)
Details
Attachments
(1 file, 1 obsolete file)
(deleted),
patch
|
Biesinger
:
review+
Biesinger
:
superreview+
|
Details | Diff | Splinter Review |
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.
Assignee | ||
Comment 1•17 years ago
|
||
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)
Assignee | ||
Comment 2•17 years ago
|
||
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 3•17 years ago
|
||
Comment on attachment 270221 [details] [diff] [review]
Patch
looks good. make sure to test this before checking in :-)
Attachment #270221 -
Flags: review?(cbiesinger) → review+
Assignee | ||
Comment 4•17 years ago
|
||
Comment on attachment 270221 [details] [diff] [review]
Patch
This passes all my tests :)
Attachment #270221 -
Flags: superreview?(cbiesinger)
Updated•17 years ago
|
Attachment #270221 -
Flags: superreview?(cbiesinger) → superreview+
Assignee | ||
Comment 5•17 years ago
|
||
Fixed on trunk.
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Comment 7•17 years ago
|
||
Could this have caused bug 386712?
Assignee | ||
Comment 8•17 years ago
|
||
(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.
Description
•