Closed Bug 23667 Opened 26 years ago Closed 25 years ago

NPP_StreamAsFile is never called

Categories

(Core Graveyard :: Plug-ins, defect, P3)

x86
Windows NT
defect

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: rginda, Assigned: serhunt)

References

()

Details

(Keywords: shockwave, Whiteboard: [nsbeta2+])

Attachments

(3 files)

The test page mentioned in the above url works fine in 4x, but seems to start improperly in Mozilla. Console output: InstantiateEmbededPlugin for application/x-kaon-nimble debug: edburns ns4xPlugin::CreatePlugin instance start called created stream for http://newton.kaon.com/trip/trip.nim InstantiateFullPagePlugin.. returning Document http://newton.kaon.com/trip/test.html loaded successfully Document: Done (12.296 secs) killing stream for http://newton.kaon.com/trip/trip.nim
I see this. The plugin window shows a message " Reading program..." and then does nothing.
I wrote the plugin in question (it works in Netscape 3 & 4, and Opera), and using my debugger, I have confirmed that the following sequece of event occurs: NPP_New is called NPP_SetWindow is called NPP_NewStream is called -- I return NP_AsFile in *stype, and return NPERR_NO_ERROR as my return value NPP_WriteReady is called -- I return STREAMBUFSIZE (which is 0x0FFFFFFF like the samples) NPP_Write is called with my data NPP_DestroyStream is called NPP_StreamAsFile is never called! That's why the plugin doesn't start up.
Oh, forgot to mention: I return "len" in NPP_Write, and NPP_DestroyStream has a reason of 0.
This is related to 27763.
Depends on: 27763
Status: NEW → ASSIGNED
Target Milestone: --- → M17
*** Bug 15546 has been marked as a duplicate of this bug. ***
*** Bug 16519 has been marked as a duplicate of this bug. ***
*** Bug 18320 has been marked as a duplicate of this bug. ***
*** Bug 18902 has been marked as a duplicate of this bug. ***
Marking shockwave as bug 15546 and bug16519 are marked DUPs of this bug and indicates that this problem also affects shockwave. Nominating nsbeta2 as having shockwave work is part of beta2 criteria. Changing summary to "NPP_StreamAsFile is never called" to make the issue clearer. VYV03354, just to confirm, are we 100% certain that each of those bugs is really the exact same issue as this bug (i.e. "NPP_StreamAsFile is never called")? (I'm totally ignorant about the technical internals here and can't tell either way myself.) The previous Summary was quite generic ("Plugin does not work correctly,") and we wouldn't want to DUP all other examples of plug-ins not working correctly for different reasons. If these bugs are indeed all caused by NPP_StreamAsFile not being called, thanks for great detective work on finding the DUPs! If not, would you please REOPEN the other reports? Thanks!
Keywords: nsbeta2, shockwave
Summary: Plugin does not work properly → NPP_StreamAsFile is never called
We couldn't call NPP_StreamAsFile since disk cache did not exist. So, in my understanding, "marked later until disk cache arrives" bug is a same problem. But I'm reopening bug 16519 and adding dependency since it also covers another problem (NPP_DestroyStream).
Blocks: 16519
By the way, http://newton.kaon.com/trip/test.html seems to be no longer available. Where is the new URL?
No longer blocks: 16519
NPP_StreamAsFile is called now because of linux legacy plug-in support. (thanks, rusty!) I copyed tmpfile stuff from pre-necko code since current code is for linux only. And I removed workaround for bug 16519 to avoid NPP_DestroyStream called twice. This seems to be working.
There's a similar patch for the tmp file stuff over at http://bugzilla.mozilla.org/show_bug.cgi?id=37237. But it should be noted that these are just temporary workarounds. Using the tmp dir should not be a substitute for a working cache.
A new URL where you can test is: http://www.kaon.com/gallery.html
Putting on [nsbeta2+] radar for beta2 fix.
Whiteboard: [nsbeta2+]
Added patch that fixes nsPluginHostImpt.cpp - uses the browser cache. Removed all the code that were work arounds for not having a cache. Tested on Win32 using an xpcom plugin and using the nn4 flash plugin.
Keywords: patch
*** Bug 27763 has been marked as a duplicate of this bug. ***
adding myself to cc
Fix checked in.
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
The test url is outdated. Pls provide a new url to verify this bug. Thnx.
Updated URL from Joshua's comment. The plugin in question seems to get further than it used to, but doesn't actually work for me yet. Perhaps this is due to some other problem.
Yes, this still does not work. The plugin window opens but I see an error saying " Error processing File: XML error at Line1 : not well-formed." Reopening this bug. Build used:2000070508 on windows.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
That error message is most likely caused by my code not groking that a compressed file (".nmz") is compressed, which would most likely be caused by the new Mozilla caching code not preserving file name extensions. Is that the case? Alternately, it might be that the caching code is changing the file contents somehow. If the file you are hitting is a ".nmz", you can gunzip it to see the original XML. If the file is a ".nim" the XML is right there. Let me know if you need me to download the latest mozilla build and run my stuff under the debugger to give you more details...
Latest Mozilla binaries are at ftp://ftp.mozilla.org/pub/mozilla/nightly/latest/ If you'd like to run Mozilla under a debugger, you can build it yourself using the source tarball (in the same place as the binaries) or by pulling from CVS, see http://www.mozilla.org/build/ for more info, or email me.
Correct - filenames and extensions are not preserved in the cache.
Sean, should this be reassigned to cache people?
This turned out to be 2 problems. The first, NPP_StreamAsFile is never called, has been fixed. The second is cache related and should be opened as a separate bug if at all. I gave Joshua a workaround that he can use in his 4x plugin but that doesn't address the fact that the cached file does not maintain its file extension in mozilla as it did in nn4.
I filed a new bug 'Cache does not preserve file names' -- 44721. Marking this one fixed.
Now really marking.
Status: REOPENED → RESOLVED
Closed: 25 years ago25 years ago
Resolution: --- → FIXED
verified that plugin part is working (2000070608).
Status: RESOLVED → VERIFIED
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: