Closed Bug 359801 Opened 19 years ago Closed 8 years ago

Plugin API fails to deliver some files from cache when requested NP_ASFILEONLY

Categories

(Core Graveyard :: Plug-ins, defect)

1.8 Branch
defect
Not set
major

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: vanessa, Unassigned)

Details

User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X; de-de) AppleWebKit/418.9 (KHTML, like Gecko) Safari/419.3 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8.1) Gecko/20061010 Firefox/2.0 When requesting an URL via NPN_GetUrlNotify and setting stype to NP_ASFILEONLY, sometimes no corresponding call to NPP_StreamAsFile is made *even* though it was successful, that is, NPP_URLNotify is called with reason=NPRES_DONE. This seems to happen mostly with GIF and PNG urls, but that may be a coincidence. A WORKAROUND that I implemented recently for the Squeak-Plugin is to detect that case, and request the URL again in NP_NORMAL mode, because the streaming actually works. When requesting NP_ASFILE, streaming works but the file is not delivered via NPP_StreamAsFile. This seems to have to do with caching, and can be reproduced by manually deleting cached files, as described below. HOWEVER, this happens in regular use, too, not only when messing around with the cache. This bug is cross-platforms, confirmed on Solaris and Windows, I think I have seen it on Linux and MacOSX, too. Also, this dates back quite a while, though I am not sure to when. Reproducible: Sometimes Steps to Reproduce: 1. Go to some PNG URL and make sure it's cached on disk 2. Request it from a plugin with NPN_GetUrlNotify 3. return NP_ASFILEONLY in NPP_StreamAsFile 4. look for the file name in NPP_StreamAsFile. If NPP_StreamAsFile is not called, you reproduced the BUG 5. Otherwise, manually delete the filename delivered in NPP_StreamAsFile 6. Go to the same URL in the browser (not plugin) again, you will get a file not found, press shift-reload to resolve this 7. Continue with step 2 Actual Results: NPP_StreamAsFile is not called Expected Results: NPP_StreamAsFile should have been called NPN_GetUrlNotify(http://www.sun.com/im/bg_green_curve_bubble.png) NPP_NewStream(http://www.sun.com/im/bg_green_curve_bubble.png) answer NP_ASFILE NPP_Write(http://www.sun.com/im/bg_green_curve_bubble.png, 2698) missing call to NPP_DestroyStream(http://www.sun.com/im/bg_green_curve_bubble.png) NPP_URLNotify(http://www.sun.com/im/bg_green_curve_bubble.png, reason=NPRES_DONE)
Component: General → Plug-ins
Product: Firefox → Core
QA Contact: general → plugins
Version: unspecified → 1.8 Branch
Assignee: nobody → joshmoz
Assignee: joshmoz → nobody
We are deprecating the asfile methods in bug 1352567
Status: UNCONFIRMED → RESOLVED
Closed: 8 years ago
Resolution: --- → WONTFIX
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.